Skip to content

collect_workfile

CollectWorkfile

Bases: HoudiniInstancePlugin

Inject workfile representation into instance

Source code in client/ayon_houdini/plugins/publish/collect_workfile.py
 6
 7
 8
 9
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
class CollectWorkfile(plugin.HoudiniInstancePlugin):
    """Inject workfile representation into instance"""

    order = pyblish.api.CollectorOrder - 0.01
    label = "Houdini Workfile Data"
    families = ["workfile"]

    def process(self, instance):

        current_file = instance.context.data["currentFile"]
        folder, file = os.path.split(current_file)
        filename, ext = os.path.splitext(file)

        instance.data.update({
            "setMembers": [current_file],
            "frameStart": instance.context.data['frameStart'],
            "frameEnd": instance.context.data['frameEnd'],
            "handleStart": instance.context.data['handleStart'],
            "handleEnd": instance.context.data['handleEnd']
        })

        instance.data['representations'] = [{
            'name': ext.lstrip("."),
            'ext': ext.lstrip("."),
            'files': file,
            "stagingDir": folder,
        }]

        self.log.debug('Collected workfile instance: {}'.format(file))