A module containing generic loader actions that will display in the Loader.
SetFrameRangeLoader
Bases: LoaderPlugin
Set frame range excluding pre- and post-handles
Source code in client/ayon_nuke/plugins/load/actions.py
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 | class SetFrameRangeLoader(load.LoaderPlugin):
"""Set frame range excluding pre- and post-handles"""
product_types = {
"animation",
"camera",
"write",
"yeticache",
"pointcache",
}
representations = {"*"}
extensions = {"*"}
label = "Set frame range"
order = 11
icon = "clock-o"
color = "white"
def load(self, context, name, namespace, data):
version_entity = context["version"]
version_attributes = version_entity["attrib"]
start = version_attributes.get("frameStart")
end = version_attributes.get("frameEnd")
log.info("start: {}, end: {}".format(start, end))
if start is None or end is None:
log.info("Skipping setting frame range because start or "
"end frame data is missing..")
return
lib.update_frame_range(start, end)
|
SetFrameRangeWithHandlesLoader
Bases: LoaderPlugin
Set frame range including pre- and post-handles
Source code in client/ayon_nuke/plugins/load/actions.py
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77 | class SetFrameRangeWithHandlesLoader(load.LoaderPlugin):
"""Set frame range including pre- and post-handles"""
product_types = {
"animation",
"camera",
"write",
"yeticache",
"pointcache",
}
representations = {"*"}
label = "Set frame range (with handles)"
order = 12
icon = "clock-o"
color = "white"
def load(self, context, name, namespace, data):
version_attributes = context["version"]["attrib"]
start = version_attributes.get("frameStart")
end = version_attributes.get("frameEnd")
if start is None or end is None:
print("Skipping setting frame range because start or "
"end frame data is missing..")
return
# Include handles
start -= version_attributes.get("handleStart", 0)
end += version_attributes.get("handleEnd", 0)
lib.update_frame_range(start, end)
|