Skip to content

validate_wait_for_render

ValidateWaitForRender

Bases: HoudiniInstancePlugin

Validate WaitForRendertoComplete is enabled.

Disabling WaitForRendertoComplete cause the local render to fail as the publish execution continues while the render may not be finished yet.

Source code in client/ayon_houdini/plugins/publish/validate_wait_for_render.py
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
class ValidateWaitForRender(plugin.HoudiniInstancePlugin):
    """Validate `WaitForRendertoComplete` is enabled.

    Disabling `WaitForRendertoComplete` cause the local render to fail
    as the publish execution continues while the render may not be
    finished yet.
    """

    order = pyblish.api.ValidatorOrder
    families = ["usdrender"]
    label = "Validate Wait For Render to Complete"
    actions = [RepairAction]

    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(
                f"Skipping instance without instance node: {instance}"
            )
            return

        if instance.data["creator_attributes"].get("render_target") != "local":
            # This validator should work only with local render target.
            self.log.debug(
                "Skipping Validator, Render target"
                " is not 'Local machine rendering'"
            )
            return

        invalid = self.get_invalid(instance)
        if invalid:
            rop = invalid[0]
            raise PublishValidationError(
                f"ROP node '{rop.path()}' has 'Wait For Render"
                " to Complete' parm disabled.Please, enable it.",
                title=self.label
            )

    @classmethod
    def get_invalid(cls, instance):
        rop = hou.node(instance.data["instance_node"])
        if not rop.evalParm("soho_foreground"):
            return [rop]

    @classmethod
    def repair(cls, instance):
        """Enable WaitForRendertoComplete. """

        rop = hou.node(instance.data["instance_node"])
        rop.parm("soho_foreground").set(True)

repair(instance) classmethod

Enable WaitForRendertoComplete.

Source code in client/ayon_houdini/plugins/publish/validate_wait_for_render.py
56
57
58
59
60
61
@classmethod
def repair(cls, instance):
    """Enable WaitForRendertoComplete. """

    rop = hou.node(instance.data["instance_node"])
    rop.parm("soho_foreground").set(True)