Skip to content

validate_bypass

ValidateBypassed

Bases: HoudiniInstancePlugin

Validate all primitives build hierarchy from attribute when enabled.

The name of the attribute must exist on the prims and have the same name as Build Hierarchy from Attribute's Path Attribute value on the Alembic ROP node whenever Build Hierarchy from Attribute is enabled.

Source code in client/ayon_houdini/plugins/publish/validate_bypass.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class ValidateBypassed(plugin.HoudiniInstancePlugin):
    """Validate all primitives build hierarchy from attribute when enabled.

    The name of the attribute must exist on the prims and have the same name
    as Build Hierarchy from Attribute's `Path Attribute` value on the Alembic
    ROP node whenever Build Hierarchy from Attribute is enabled.

    """

    order = pyblish.api.ValidatorOrder - 0.1
    families = ["*"]
    label = "Validate ROP Bypass"

    def process(self, instance):

        if not instance.data.get("instance_node"):
            # Ignore instances without an instance node
            # e.g. in memory bootstrap instances
            self.log.debug(
                "Skipping instance without instance node: {}".format(instance)
            )
            return

        invalid = self.get_invalid(instance)
        if invalid:
            rop = invalid[0]
            raise PublishValidationError(
                ("ROP node {} is set to bypass, publishing cannot "
                 "continue.".format(rop.path())),
                title=self.label
            )

    @classmethod
    def get_invalid(cls, instance):

        rop = hou.node(instance.data["instance_node"])
        if hasattr(rop, "isBypassed") and rop.isBypassed():
            return [rop]