Skip to content

validate_shapes

ValidateShapes

Bases: InstancePlugin

Validate shapes exist on node.

Source code in client/ayon_silhouette/plugins/publish/validate_shapes.py
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class ValidateShapes(pyblish.api.InstancePlugin):
    """Validate shapes exist on node."""

    label = "Missing Shapes"
    hosts = ["silhouette"]
    families = ["matteshapes"]
    order = pyblish.api.ValidatorOrder

    def process(self, instance):
        # Node should be a node that contains 'shapes' children
        node = instance.data["transientData"]["instance_node"]
        if not any(
            shape for shape, _label in lib.iter_children(node)
            if isinstance(shape, fx.Shape)
        ):
            raise publish.PublishValidationError(
                "No shapes found on node: {0}".format(node.label)
            )