Bases: InstancePlugin
Collect Frame Data From taskEntity
or folderEntity
of instance.
Frame range data will only be collected if the keys are not yet collected for the instance.
Source code in client/ayon_traypublisher/plugins/publish/collect_frame_data_from_folder_entity.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57 | class CollectFrameDataFromAssetEntity(pyblish.api.InstancePlugin):
"""Collect Frame Data From `taskEntity` or `folderEntity` of instance.
Frame range data will only be collected if the keys are not yet
collected for the instance.
"""
order = pyblish.api.CollectorOrder + 0.491
label = "Collect Missing Frame Data From Folder/Task"
families = [
"plate",
"pointcache",
"vdbcache",
"online",
"render",
]
hosts = ["traypublisher"]
def process(self, instance):
missing_keys = []
for key in (
"fps",
"frameStart",
"frameEnd",
"handleStart",
"handleEnd",
):
if key not in instance.data:
missing_keys.append(key)
# Skip the logic if all keys are already collected.
# NOTE: In editorial is not 'folderEntity' filled, so it would crash
# even if we don't need it.
if not missing_keys:
return
keys_set = []
folder_entity = instance.data["folderEntity"]
task_entity = instance.data.get("taskEntity")
context_attributes = (
task_entity["attrib"] if task_entity else folder_entity["attrib"]
)
for key in missing_keys:
if key in context_attributes:
instance.data[key] = context_attributes[key]
keys_set.append(key)
if keys_set:
self.log.debug(
f"Frame range data {keys_set} "
"has been collected from folder (or task) entity."
)
|