mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-27 14:22:37 +01:00
Raise PublishValidationError
This commit is contained in:
parent
7bc2dc14af
commit
49bdb7f6ff
1 changed files with 14 additions and 1 deletions
|
|
@ -5,9 +5,17 @@ import openpype.hosts.maya.api.action
|
|||
from openpype.pipeline.publish import (
|
||||
RepairAction,
|
||||
ValidateContentsOrder,
|
||||
PublishValidationError
|
||||
)
|
||||
|
||||
|
||||
def _as_report_list(values, prefix="- ", suffix="\n"):
|
||||
"""Return list as bullet point list for a report"""
|
||||
if not values:
|
||||
return ""
|
||||
return prefix + (suffix + prefix).join(values)
|
||||
|
||||
|
||||
def has_shape_children(node):
|
||||
# Check if any descendants
|
||||
allDescendents = cmds.listRelatives(node,
|
||||
|
|
@ -64,7 +72,12 @@ class ValidateNoNullTransforms(pyblish.api.InstancePlugin):
|
|||
"""Process all the transform nodes in the instance """
|
||||
invalid = self.get_invalid(instance)
|
||||
if invalid:
|
||||
raise ValueError("Empty transforms found: {0}".format(invalid))
|
||||
raise PublishValidationError(
|
||||
"Empty transforms found without shapes:\n\n{0}".format(
|
||||
_as_report_list(sorted(invalid))
|
||||
),
|
||||
title="Empty transforms"
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def repair(cls, instance):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue