Bases: InstancePlugin
Collect current script for publish.
Source code in client/ayon_photoshop/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 | class CollectWorkfile(pyblish.api.InstancePlugin):
"""Collect current script for publish."""
order = pyblish.api.CollectorOrder - 0.4
label = "Collect Workfile"
hosts = ["photoshop"]
families = ["workfile"]
targets = ["local"]
default_variant = "Main"
def process(self, instance):
file_path = instance.context.data["currentFile"]
ext = os.path.splitext(file_path)[1].lstrip(".")
staging_dir = os.path.dirname(file_path)
base_name = os.path.basename(file_path)
# creating representation
instance.data["representations"].append({
"name": ext,
"ext": ext,
"files": base_name,
"stagingDir": staging_dir,
})
|