Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions client/ayon_nuke/plugins/publish/collect_writes.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,14 @@ def _set_additional_instance_data(
color_channels = write_node["channels"].value()

# get frame range data
handle_start = instance.context.data["handleStart"]
handle_end = instance.context.data["handleEnd"]
root_first_frame = int(nuke.root()["first_frame"].getValue())
root_last_frame = int(nuke.root()["last_frame"].getValue())
context_handle_start = instance.context.data["handleStart"]
context_handle_end = instance.context.data["handleEnd"]

first_frame, last_frame = self._get_frame_range_data(instance)
handle_start = max(0, root_first_frame + context_handle_start - first_frame)
handle_end = max(0, last_frame - (root_last_frame - context_handle_end))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand where root_first_frame and context_handle_start come from.
Also do you mind to detail a bit more on why you need this new logic replacing instance.context_data please ?


# get output paths
write_file_path = nuke.filename(write_node)
Expand All @@ -198,8 +203,8 @@ def _set_additional_instance_data(
for frame_number in range(
# Excluding handles to match the logic when
# loading timewarps - @splidje
int(nuke.root()["first_frame"].getValue()) + handle_start,
int(nuke.root()["last_frame"].getValue()) - handle_end + 1,
first_frame + handle_start,
last_frame - handle_end + 1,
):
# The format for this lookup list is
# the frame offset per frame
Expand All @@ -224,7 +229,7 @@ def _set_additional_instance_data(
"pixelAspect": write_node.pixelAspect(),
})

if product_base_type == "render":
if product_base_type in ("render", "plate"):
instance.data.update({
"handleStart": handle_start,
"handleEnd": handle_end,
Expand Down
Loading