Skip to content

collect_version

CollectVersion

Bases: InstancePlugin

Collect version for publishable instances.

Used to synchronize version from workfile to all publishable instances
  • image (manually created or color coded)
  • review
  • workfile

Dev comment: Explicit collector created to control this from single place and not from 3 different.

Workfile set here explicitly as version might to be forced from latest + 1 because of Webpublisher. (This plugin must run after CollectPublishedVersion!)

Source code in client/ayon_photoshop/plugins/publish/collect_version.py
 4
 5
 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
class CollectVersion(pyblish.api.InstancePlugin):
    """Collect version for publishable instances.

    Used to synchronize version from workfile to all publishable instances:
        - image (manually created or color coded)
        - review
        - workfile

    Dev comment:
    Explicit collector created to control this from single place and not from
    3 different.

    Workfile set here explicitly as version might to be forced from latest + 1
    because of Webpublisher.
    (This plugin must run after CollectPublishedVersion!)
    """
    order = pyblish.api.CollectorOrder + 0.200
    label = 'Collect Version'

    hosts = ["photoshop"]
    families = ["image", "review", "workfile"]
    settings_category = "photoshop"

    def process(self, instance):
        workfile_version = instance.context.data["version"]
        self.log.debug(f"Applying version {workfile_version}")
        instance.data["version"] = workfile_version