mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
Set up validation messages for new publisher
This commit is contained in:
parent
d87c88bd41
commit
962b5c1458
2 changed files with 19 additions and 6 deletions
|
|
@ -5,7 +5,8 @@ import openpype.hosts.maya.api.action
|
|||
from openpype.hosts.maya.api import lib
|
||||
from openpype.pipeline.publish import (
|
||||
ValidateMeshOrder,
|
||||
OptionalPyblishPluginMixin
|
||||
OptionalPyblishPluginMixin,
|
||||
PublishValidationError
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -74,5 +75,9 @@ class ValidateMeshNonZeroEdgeLength(pyblish.api.InstancePlugin,
|
|||
|
||||
invalid = self.get_invalid(instance)
|
||||
if invalid:
|
||||
raise RuntimeError("Meshes found with zero "
|
||||
"edge length: {0}".format(invalid))
|
||||
label = "Meshes found with zero edge length"
|
||||
raise PublishValidationError(
|
||||
message="{}: {}".format(label, invalid),
|
||||
title=label,
|
||||
description="{}:\n- ".format(label) + "\n- ".join(invalid)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
from collections import defaultdict
|
||||
|
||||
import pyblish.api
|
||||
from openpype.pipeline.publish import ValidatePipelineOrder
|
||||
from openpype.pipeline.publish import (
|
||||
ValidatePipelineOrder,
|
||||
PublishValidationError
|
||||
)
|
||||
import openpype.hosts.maya.api.action
|
||||
from openpype.hosts.maya.api import lib
|
||||
|
||||
|
|
@ -29,8 +32,13 @@ class ValidateNodeIdsUnique(pyblish.api.InstancePlugin):
|
|||
# Ensure all nodes have a cbId
|
||||
invalid = self.get_invalid(instance)
|
||||
if invalid:
|
||||
raise RuntimeError("Nodes found with non-unique "
|
||||
"asset IDs: {0}".format(invalid))
|
||||
label = "Nodes found with non-unique asset IDs"
|
||||
raise PublishValidationError(
|
||||
message="{}: {}".format(label, invalid),
|
||||
title="Non-unique asset ids on nodes",
|
||||
description="{}\n- {}".format(label,
|
||||
"\n- ".join(sorted(invalid)))
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get_invalid(cls, instance):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue