OP-3940 - added new collector for Photoshop

Single point of control if image and review instances should have their version synchronized according to workfile version.
This commit is contained in:
Petr Kalis 2022-09-14 18:25:11 +02:00
parent 3703ec07bc
commit d93a18fd89

View file

@ -0,0 +1,28 @@
import pyblish.api
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
Dev comment:
Explicit collector created to control this from single place and not from
3 different.
"""
order = pyblish.api.CollectorOrder + 0.200
label = 'Collect Version'
hosts = ["photoshop"]
families = ["image", "review"]
# controlled by Settings
sync_workfile_version = False
def process(self, instance):
if self.sync_workfile_version:
workfile_version = instance.context.data["version"]
self.log.debug(f"Applying version {workfile_version}")
instance.data["version"] = workfile_version