mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
Remove unused "remote publish" workflow for Houdini
This likely was once a 'straight' copy from `colorbleed` codebase back in the Avalon-era.
This commit is contained in:
parent
3446d08bed
commit
4583a44777
4 changed files with 0 additions and 203 deletions
|
|
@ -148,89 +148,6 @@ def validate_fps():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def create_remote_publish_node(force=True):
|
|
||||||
"""Function to create a remote publish node in /out
|
|
||||||
|
|
||||||
This is a hacked "Shell" node that does *nothing* except for triggering
|
|
||||||
`colorbleed.lib.publish_remote()` as pre-render script.
|
|
||||||
|
|
||||||
All default attributes of the Shell node are hidden to the Artist to
|
|
||||||
avoid confusion.
|
|
||||||
|
|
||||||
Additionally some custom attributes are added that can be collected
|
|
||||||
by a Collector to set specific settings for the publish, e.g. whether
|
|
||||||
to separate the jobs per instance or process in one single job.
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
cmd = "import colorbleed.lib; colorbleed.lib.publish_remote()"
|
|
||||||
|
|
||||||
existing = hou.node("/out/REMOTE_PUBLISH")
|
|
||||||
if existing:
|
|
||||||
if force:
|
|
||||||
log.warning("Removing existing '/out/REMOTE_PUBLISH' node..")
|
|
||||||
existing.destroy()
|
|
||||||
else:
|
|
||||||
raise RuntimeError("Node already exists /out/REMOTE_PUBLISH. "
|
|
||||||
"Please remove manually or set `force` to "
|
|
||||||
"True.")
|
|
||||||
|
|
||||||
# Create the shell node
|
|
||||||
out = hou.node("/out")
|
|
||||||
node = out.createNode("shell", node_name="REMOTE_PUBLISH")
|
|
||||||
node.moveToGoodPosition()
|
|
||||||
|
|
||||||
# Set color make it stand out (avalon/pyblish color)
|
|
||||||
node.setColor(hou.Color(0.439, 0.709, 0.933))
|
|
||||||
|
|
||||||
# Set the pre-render script
|
|
||||||
node.setParms({
|
|
||||||
"prerender": cmd,
|
|
||||||
"lprerender": "python" # command language
|
|
||||||
})
|
|
||||||
|
|
||||||
# Lock the attributes to ensure artists won't easily mess things up.
|
|
||||||
node.parm("prerender").lock(True)
|
|
||||||
node.parm("lprerender").lock(True)
|
|
||||||
|
|
||||||
# Lock up the actual shell command
|
|
||||||
command_parm = node.parm("command")
|
|
||||||
command_parm.set("")
|
|
||||||
command_parm.lock(True)
|
|
||||||
shellexec_parm = node.parm("shellexec")
|
|
||||||
shellexec_parm.set(False)
|
|
||||||
shellexec_parm.lock(True)
|
|
||||||
|
|
||||||
# Get the node's parm template group so we can customize it
|
|
||||||
template = node.parmTemplateGroup()
|
|
||||||
|
|
||||||
# Hide default tabs
|
|
||||||
template.hideFolder("Shell", True)
|
|
||||||
template.hideFolder("Scripts", True)
|
|
||||||
|
|
||||||
# Hide default settings
|
|
||||||
template.hide("execute", True)
|
|
||||||
template.hide("renderdialog", True)
|
|
||||||
template.hide("trange", True)
|
|
||||||
template.hide("f", True)
|
|
||||||
template.hide("take", True)
|
|
||||||
|
|
||||||
# Add custom settings to this node.
|
|
||||||
parm_folder = hou.FolderParmTemplate("folder", "Submission Settings")
|
|
||||||
|
|
||||||
# Separate Jobs per Instance
|
|
||||||
parm = hou.ToggleParmTemplate(name="separateJobPerInstance",
|
|
||||||
label="Separate Job per Instance",
|
|
||||||
default_value=False)
|
|
||||||
parm_folder.addParmTemplate(parm)
|
|
||||||
|
|
||||||
# Add our custom Submission Settings folder
|
|
||||||
template.append(parm_folder)
|
|
||||||
|
|
||||||
# Apply template back to the node
|
|
||||||
node.setParmTemplateGroup(template)
|
|
||||||
|
|
||||||
|
|
||||||
def render_rop(ropnode):
|
def render_rop(ropnode):
|
||||||
"""Render ROP node utility for Publishing.
|
"""Render ROP node utility for Publishing.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
import hou
|
|
||||||
import pyblish.api
|
|
||||||
|
|
||||||
from ayon_core.pipeline.publish import RepairAction
|
|
||||||
from ayon_houdini.api import lib, plugin
|
|
||||||
|
|
||||||
|
|
||||||
class CollectRemotePublishSettings(plugin.HoudiniContextPlugin):
|
|
||||||
"""Collect custom settings of the Remote Publish node."""
|
|
||||||
|
|
||||||
order = pyblish.api.CollectorOrder
|
|
||||||
families = ["*"]
|
|
||||||
targets = ["deadline"]
|
|
||||||
label = "Remote Publish Submission Settings"
|
|
||||||
actions = [RepairAction]
|
|
||||||
|
|
||||||
def process(self, context):
|
|
||||||
|
|
||||||
node = hou.node("/out/REMOTE_PUBLISH")
|
|
||||||
if not node:
|
|
||||||
return
|
|
||||||
|
|
||||||
attributes = lib.read(node)
|
|
||||||
|
|
||||||
# Debug the settings we have collected
|
|
||||||
for key, value in sorted(attributes.items()):
|
|
||||||
self.log.debug("Collected %s: %s" % (key, value))
|
|
||||||
|
|
||||||
context.data.update(attributes)
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
# -*-coding: utf-8 -*-
|
|
||||||
import hou
|
|
||||||
|
|
||||||
import pyblish.api
|
|
||||||
from ayon_core.pipeline.publish import RepairContextAction
|
|
||||||
from ayon_core.pipeline import PublishValidationError
|
|
||||||
|
|
||||||
from ayon_houdini.api import lib, plugin
|
|
||||||
|
|
||||||
|
|
||||||
class ValidateRemotePublishOutNode(plugin.HoudiniContextPlugin):
|
|
||||||
"""Validate the remote publish out node exists for Deadline to trigger."""
|
|
||||||
|
|
||||||
order = pyblish.api.ValidatorOrder - 0.4
|
|
||||||
families = ["*"]
|
|
||||||
targets = ["deadline"]
|
|
||||||
label = "Remote Publish ROP node"
|
|
||||||
actions = [RepairContextAction]
|
|
||||||
|
|
||||||
def process(self, context):
|
|
||||||
|
|
||||||
cmd = "import colorbleed.lib; colorbleed.lib.publish_remote()"
|
|
||||||
|
|
||||||
node = hou.node("/out/REMOTE_PUBLISH")
|
|
||||||
if not node:
|
|
||||||
raise RuntimeError("Missing REMOTE_PUBLISH node.")
|
|
||||||
|
|
||||||
# We ensure it's a shell node and that it has the pre-render script
|
|
||||||
# set correctly. Plus the shell script it will trigger should be
|
|
||||||
# completely empty (doing nothing)
|
|
||||||
if node.type().name() != "shell":
|
|
||||||
self.raise_error("Must be shell ROP node")
|
|
||||||
if node.parm("command").eval() != "":
|
|
||||||
self.raise_error("Must have no command")
|
|
||||||
if node.parm("shellexec").eval():
|
|
||||||
self.raise_error("Must not execute in shell")
|
|
||||||
if node.parm("prerender").eval() != cmd:
|
|
||||||
self.raise_error("REMOTE_PUBLISH node does not have "
|
|
||||||
"correct prerender script.")
|
|
||||||
if node.parm("lprerender").eval() != "python":
|
|
||||||
self.raise_error("REMOTE_PUBLISH node prerender script "
|
|
||||||
"type not set to 'python'")
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def repair(cls, context):
|
|
||||||
"""(Re)create the node if it fails to pass validation."""
|
|
||||||
lib.create_remote_publish_node(force=True)
|
|
||||||
|
|
||||||
def raise_error(self, message):
|
|
||||||
raise PublishValidationError(message)
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
import hou
|
|
||||||
|
|
||||||
import pyblish.api
|
|
||||||
from ayon_core.pipeline.publish import RepairContextAction
|
|
||||||
from ayon_core.pipeline import PublishValidationError
|
|
||||||
|
|
||||||
from ayon_houdini.api import plugin
|
|
||||||
|
|
||||||
|
|
||||||
class ValidateRemotePublishEnabled(plugin.HoudiniContextPlugin):
|
|
||||||
"""Validate the remote publish node is *not* bypassed."""
|
|
||||||
|
|
||||||
order = pyblish.api.ValidatorOrder - 0.39
|
|
||||||
families = ["*"]
|
|
||||||
targets = ["deadline"]
|
|
||||||
label = "Remote Publish ROP enabled"
|
|
||||||
actions = [RepairContextAction]
|
|
||||||
|
|
||||||
def process(self, context):
|
|
||||||
|
|
||||||
node = hou.node("/out/REMOTE_PUBLISH")
|
|
||||||
if not node:
|
|
||||||
raise PublishValidationError(
|
|
||||||
"Missing REMOTE_PUBLISH node.", title=self.label)
|
|
||||||
|
|
||||||
if node.isBypassed():
|
|
||||||
raise PublishValidationError(
|
|
||||||
"REMOTE_PUBLISH must not be bypassed.", title=self.label)
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def repair(cls, context):
|
|
||||||
"""(Re)create the node if it fails to pass validation."""
|
|
||||||
|
|
||||||
node = hou.node("/out/REMOTE_PUBLISH")
|
|
||||||
if not node:
|
|
||||||
raise PublishValidationError(
|
|
||||||
"Missing REMOTE_PUBLISH node.", title=cls.label)
|
|
||||||
|
|
||||||
cls.log.info("Disabling bypass on /out/REMOTE_PUBLISH")
|
|
||||||
node.bypass(False)
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue