Skip to content
Merged
Changes from 1 commit
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
24 changes: 21 additions & 3 deletions client/ayon_nuke/plugins/publish/collect_writes.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def process(self, instance):
self._set_existing_files_data(instance, colorspace)

elif render_target == "frames_farm":
collected_frames = self._get_collected_frames(instance)
collected_frames = self._get_collected_frames_with_slate(instance)

self._set_expected_files(instance, collected_frames)

Expand All @@ -73,7 +73,7 @@ def _set_existing_files_data(self, instance, colorspace):
Returns:
list: collected frames
"""
collected_frames = self._get_collected_frames(instance)
collected_frames = self._get_collected_frames_with_slate(instance)

representation = self._get_existing_frames_representation(
instance, collected_frames
Expand Down Expand Up @@ -363,7 +363,7 @@ def _add_slate_frame_to_collected_frames(
expected_slate_frame = first_frame - 1
expected_slate_path = write_node["file"].evaluate(expected_slate_frame)

if not os.path.exists(expected_slate_path):
if os.path.exists(expected_slate_path):
slate_frame = os.path.basename(expected_slate_path)
collected_frames.insert(0, slate_frame)
Comment on lines -369 to 364

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, this does make more sense 🤔 - @jakubjezek001 @moonyuet any thoughts?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Indeed.


Expand Down Expand Up @@ -428,6 +428,24 @@ def _get_collected_frames(self, instance):

return collected_frames

def _get_collected_frames_with_slate(self, instance):
"""Get collected frames and include slate frame if available.

Args:
instance (pyblish.api.Instance): pyblish instance

Returns:
list: collected frames with slate if available
"""

first_frame, _ = self._get_frame_range_data(instance)
collected_frames = self._get_collected_frames(instance)

return self._add_slate_frame_to_collected_frames(
instance,
collected_frames,
first_frame
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doesn't have to be an extra method I'd say. This logic can just live at the end of _get_collected_frames because it applies to all calls to it anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, have pushed the change :D


def _find_downstream_time_warp_node(start_node):
# HACK: no idea why calling `dependentNodes` the first time
Expand Down
Loading