Skip to content

collect_sync_workfile_version

CollectSyncWorkfileVersion

Bases: InstancePlugin

Collect sync workfile version to instance data after scene version is collected by CollectSceneVersion.

Source code in client/ayon_nuke/plugins/publish/collect_sync_workfile_version.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class CollectSyncWorkfileVersion(pyblish.api.InstancePlugin):
    """Collect sync workfile version to instance data
    after scene version is collected by CollectSceneVersion.
    """

    order = pyblish.api.CollectorOrder + 0.001
    label = "Collect Sync Workfile Version"
    hosts = ["nuke", "nukeassist"]

    settings_category = "nuke"

    # presets
    sync_workfile_version_on_product_base_types: list[str] = []

    def process(self, instance: pyblish.api.Instance):
        product_base_type: str = instance.data["productBaseType"]
        # sync workfile version
        if product_base_type in self.sync_workfile_version_on_product_base_types:  # noqa: E501
            self.log.debug(
                f"Syncing version with workfile for '{product_base_type}'"
            )
            # get version to instance for integration
            instance.data['version'] = instance.context.data['version']