Skip to content

validate_mesh_is_static

Validator for correct naming of Static Meshes.

ValidateMeshIsStatic

Bases: HoudiniInstancePlugin, OptionalPyblishPluginMixin

Validate mesh is static.

It checks if output node is time dependent. this avoids getting different output from ROP node when extracted from a different frame than the first frame. (Might be overly restrictive though)

Source code in client/ayon_houdini/plugins/publish/validate_mesh_is_static.py
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
class ValidateMeshIsStatic(plugin.HoudiniInstancePlugin,
                           OptionalPyblishPluginMixin):
    """Validate mesh is static.

    It checks if output node is time dependent.
    this avoids getting different output from ROP node when extracted
    from a different frame than the first frame.
    (Might be overly restrictive though)
    """

    families = ["staticMesh",
                "model"]
    label = "Validate Mesh is Static"
    order = ValidateContentsOrder + 0.1
    actions = [SelectInvalidAction]

    def process(self, instance):

        invalid = self.get_invalid(instance)
        if invalid:
            nodes = [n.path() for n in invalid]
            raise PublishValidationError(
                "See log for details. "
                "Invalid nodes: {0}".format(nodes)
            )

    @classmethod
    def get_invalid(cls, instance):

        invalid = []

        output_node = instance.data.get("output_node")
        if output_node is None:
            cls.log.debug(
                "No Output Node, skipping check.."
            )
            return

        all_outputs = get_output_children(output_node)

        for output in all_outputs:
            if output.isTimeDependent():
                invalid.append(output)
                cls.log.error(
                    "Output node '%s' is time dependent.",
                    output.path()
                )

        return invalid