mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
fusion: improving custom frame range
This commit is contained in:
parent
801b904aea
commit
c80842f5a9
3 changed files with 25 additions and 6 deletions
|
|
@ -40,6 +40,11 @@ class CreateSaver(NewCreator):
|
|||
"{workdir}/renders/fusion/{subset}/{subset}.{frame}.{ext}")
|
||||
|
||||
def create(self, subset_name, instance_data, pre_create_data):
|
||||
self.pass_pre_attributes_to_instance(
|
||||
instance_data,
|
||||
pre_create_data
|
||||
)
|
||||
|
||||
instance_data.update({
|
||||
"id": "pyblish.avalon.instance",
|
||||
"subset": subset_name
|
||||
|
|
@ -215,6 +220,9 @@ class CreateSaver(NewCreator):
|
|||
attr_defs = [
|
||||
self._get_render_target_enum(),
|
||||
self._get_reviewable_bool(),
|
||||
BoolDef(
|
||||
"custom_range", label="Custom range", default=False,
|
||||
)
|
||||
]
|
||||
return attr_defs
|
||||
|
||||
|
|
@ -229,6 +237,19 @@ class CreateSaver(NewCreator):
|
|||
]
|
||||
return attr_defs
|
||||
|
||||
def pass_pre_attributes_to_instance(
|
||||
self,
|
||||
instance_data,
|
||||
pre_create_data,
|
||||
keys=None
|
||||
):
|
||||
if not keys:
|
||||
keys = pre_create_data.keys()
|
||||
|
||||
creator_attrs = instance_data["creator_attributes"] = {}
|
||||
for pass_key in keys:
|
||||
creator_attrs[pass_key] = pre_create_data[pass_key]
|
||||
|
||||
# These functions below should be moved to another file
|
||||
# so it can be used by other plugins. plugin.py ?
|
||||
|
||||
|
|
|
|||
|
|
@ -34,19 +34,17 @@ class CollectInstanceData(pyblish.api.InstancePlugin):
|
|||
start_handle = start - handle_start
|
||||
end_handle = end + handle_end
|
||||
|
||||
if creator_attributes["custom_range"]:
|
||||
if creator_attributes.get("custom_range"):
|
||||
# get comp frame ranges
|
||||
start = context.data["compFrameStart"]
|
||||
end = context.data["compFrameEnd"]
|
||||
handle_start = 0
|
||||
handle_end = 0
|
||||
start_handle = context.data["compFrameStartHandle"]
|
||||
end_handle = context.data["compFrameEndHandle"]
|
||||
start_handle = start
|
||||
end_handle = end
|
||||
|
||||
# Include start and end render frame in label
|
||||
subset = instance.data["subset"]
|
||||
start = context.data["frameStart"]
|
||||
end = context.data["frameEnd"]
|
||||
label = "{subset} ({start}-{end})".format(subset=subset,
|
||||
start=int(start),
|
||||
end=int(end))
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class CollectFusionRender(
|
|||
frameEnd=inst.data["frameEnd"],
|
||||
handleStart=inst.data["handleStart"],
|
||||
handleEnd=inst.data["handleEnd"],
|
||||
ignoreFrameHandleCheck=True,
|
||||
ignoreFrameHandleCheck=(not inst.data.get("custom_range")),
|
||||
frameStep=1,
|
||||
fps=comp_frame_format_prefs.get("Rate"),
|
||||
app_version=comp.GetApp().Version,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue