This commit is contained in:
Kayla Man 2023-10-05 20:41:44 +08:00
parent ad252347c0
commit e364f4e74c

View file

@ -19,20 +19,21 @@ class ValidateTyFlowData(pyblish.api.InstancePlugin):
2. Validate if tyFlow operator Export Particle exists
"""
report = []
invalid_object = self.get_tyflow_object(instance)
if invalid_object:
self.log.error(f"Non tyFlow object found: {invalid_object}")
invalid_operator = self.get_tyflow_operator(instance)
if invalid_operator:
self.log.error(
"Operator 'Export Particles' not found in tyFlow editor.")
if report:
if invalid_object or invalid_operator:
raise PublishValidationError(
"issues occurred",
description="Container should only include tyFlow object\n "
"and tyflow operator Export Particle should be in the tyFlow editor")
"and tyflow operator 'Export Particle' should be in \n"
"the tyFlow editor")
def get_tyflow_object(self, instance):
"""Get the nodes which are not tyFlow object(s)