Skip to content

Commit

Permalink
Refactor logic to be even simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
kalisp committed Dec 9, 2024
1 parent 2e2b2f9 commit 06f6b51
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions client/ayon_core/pipeline/farm/pyblish_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,23 +518,14 @@ def _get_real_files_to_render(collection, frames_to_render):
>>
["foo_v01.0001.exr"] - only explicitly requested frame returned
"""
found_frame_pattern_length = collection.padding
normalized_frames_to_render = {
str(frame_to_render).zfill(found_frame_pattern_length)
for frame_to_render in frames_to_render
}

head_name = os.path.basename(collection.head)
normalized_filenames = {
f"{head_name}{frame}{collection.tail}"
for frame in normalized_frames_to_render
}
file_names = [os.path.basename(f) for f in collection]
return [
file_name
for file_name in file_names
if file_name in normalized_filenames
]
included_frames = set(collection.indexes).intersection(frames_to_render)
real_collection = clique.Collection(
collection.head,
collection.tail,
collection.padding,
indexes=included_frames
)
return list(real_collection)


def create_instances_for_aov(instance, skeleton, aov_filter,
Expand Down

0 comments on commit 06f6b51

Please sign in to comment.