Merge pull request #5568 from BigRoy/enhancement/houdini_raise_publishvalidationerror

This commit is contained in:
Ondřej Samohel 2023-09-06 09:58:21 +02:00 committed by GitHub
commit 91ab216b9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 15 deletions

View file

@ -1,5 +1,7 @@
import pyblish.api import pyblish.api
from openpype.pipeline.publish import KnownPublishError
class CollectOutputSOPPath(pyblish.api.InstancePlugin): class CollectOutputSOPPath(pyblish.api.InstancePlugin):
"""Collect the out node's SOP/COP Path value.""" """Collect the out node's SOP/COP Path value."""
@ -58,8 +60,8 @@ class CollectOutputSOPPath(pyblish.api.InstancePlugin):
elif node_type == "Redshift_Proxy_Output": elif node_type == "Redshift_Proxy_Output":
out_node = node.parm("RS_archive_sopPath").evalAsNode() out_node = node.parm("RS_archive_sopPath").evalAsNode()
else: else:
raise ValueError( raise KnownPublishError(
"ROP node type '%s' is" " not supported." % node_type "ROP node type '{}' is not supported.".format(node_type)
) )
if not out_node: if not out_node:

View file

@ -2,7 +2,7 @@ import pyblish.api
from openpype.lib import version_up from openpype.lib import version_up
from openpype.pipeline import registered_host from openpype.pipeline import registered_host
from openpype.action import get_errored_plugins_from_data from openpype.pipeline.publish import get_errored_plugins_from_context
from openpype.hosts.houdini.api import HoudiniHost from openpype.hosts.houdini.api import HoudiniHost
from openpype.pipeline.publish import KnownPublishError from openpype.pipeline.publish import KnownPublishError
@ -27,7 +27,7 @@ class IncrementCurrentFile(pyblish.api.ContextPlugin):
def process(self, context): def process(self, context):
errored_plugins = get_errored_plugins_from_data(context) errored_plugins = get_errored_plugins_from_context(context)
if any( if any(
plugin.__name__ == "HoudiniSubmitPublishDeadline" plugin.__name__ == "HoudiniSubmitPublishDeadline"
for plugin in errored_plugins for plugin in errored_plugins
@ -40,9 +40,10 @@ class IncrementCurrentFile(pyblish.api.ContextPlugin):
# Filename must not have changed since collecting # Filename must not have changed since collecting
host = registered_host() # type: HoudiniHost host = registered_host() # type: HoudiniHost
current_file = host.current_file() current_file = host.current_file()
assert ( if context.data["currentFile"] != current_file:
context.data["currentFile"] == current_file raise KnownPublishError(
), "Collected filename mismatches from current scene name." "Collected filename mismatches from current scene name."
)
new_filepath = version_up(current_file) new_filepath = version_up(current_file)
host.save_workfile(new_filepath) host.save_workfile(new_filepath)

View file

@ -1,5 +1,6 @@
import pyblish.api import pyblish.api
from openpype.pipeline.publish import PublishValidationError
from openpype.hosts.houdini.api import lib from openpype.hosts.houdini.api import lib
import hou import hou
@ -30,7 +31,7 @@ class ValidateAnimationSettings(pyblish.api.InstancePlugin):
invalid = self.get_invalid(instance) invalid = self.get_invalid(instance)
if invalid: if invalid:
raise RuntimeError( raise PublishValidationError(
"Output settings do no match for '%s'" % instance "Output settings do no match for '%s'" % instance
) )

View file

@ -36,11 +36,11 @@ class ValidateRemotePublishOutNode(pyblish.api.ContextPlugin):
if node.parm("shellexec").eval(): if node.parm("shellexec").eval():
self.raise_error("Must not execute in shell") self.raise_error("Must not execute in shell")
if node.parm("prerender").eval() != cmd: if node.parm("prerender").eval() != cmd:
self.raise_error(("REMOTE_PUBLISH node does not have " self.raise_error("REMOTE_PUBLISH node does not have "
"correct prerender script.")) "correct prerender script.")
if node.parm("lprerender").eval() != "python": if node.parm("lprerender").eval() != "python":
self.raise_error(("REMOTE_PUBLISH node prerender script " self.raise_error("REMOTE_PUBLISH node prerender script "
"type not set to 'python'")) "type not set to 'python'")
@classmethod @classmethod
def repair(cls, context): def repair(cls, context):
@ -48,5 +48,4 @@ class ValidateRemotePublishOutNode(pyblish.api.ContextPlugin):
lib.create_remote_publish_node(force=True) lib.create_remote_publish_node(force=True)
def raise_error(self, message): def raise_error(self, message):
self.log.error(message) raise PublishValidationError(message)
raise PublishValidationError(message, title=self.label)

View file

@ -24,7 +24,7 @@ class ValidateUSDRenderProductNames(pyblish.api.InstancePlugin):
if not os.path.isabs(filepath): if not os.path.isabs(filepath):
invalid.append( invalid.append(
"Output file path is not " "absolute path: %s" % filepath "Output file path is not absolute path: %s" % filepath
) )
if invalid: if invalid: