-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor filtering by explicit frames #1039
Conversation
Remainder has now real way to find frame pattern from single file. Doesn't make sense to filter on single file.
Previous implementation was naive and could be dangerous. Updated docstrings. Renamed.
Return another error:
|
…re/frames_to_render_filtering_safer
…_safer' into chore/frames_to_render_filtering_safer
>> | ||
["foo_v01.0001.exr"] - only explicitly requested frame returned | ||
""" | ||
found_frame_pattern_length = collection.padding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do note that clique.assemble
creates a clique.Collection
where padding
is 0
if it has no frame starting with 0
by default. See the assume_padded_when_ambiguous
argument to clique.assemble
in recent clique
versions here.
The question is however whether that could be problematic. If e.g. someone has explicit frame to render 999 but the assembled sequence was 1001-1010 then padding would be zero instead of four meaning we'd get:
- 999.exr
- 1000.exr
- 1001.exr
Instead of:
- 0999.exr
- 1000.exr
- 1001.exr
Whether that's problematic, I'm not sure - just wanted to clarify that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, wouldn't it just work to do:
# Get overlapping frame ranges
included_frames = set(collection.indexes).intersection(frames_to_render)
# Create matching collection that refers to those frames
# and get their filenames.
collection =
collection.indexes.clear()
collection.indexes.update(included_frames)
return list(collection)
Note that this changes the input collection
- if you don't want that you may need to create a copy collection or just do:
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't test - but code changes make sense.
Changelog Description
Simplified filtering of explicit frames set by artist in Publisher UI. This should be more explicit and safer.
Removed filtering on remainders, eg. single files as there is no real safe way how to get frame pattern there and it doesn't make sense for artist to filter on single file.
Testing notes:
Frames
to explicitly filter only specific frames