-
Notifications
You must be signed in to change notification settings - Fork 39
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 OTIO frame range collection #1060
base: develop
Are you sure you want to change the base?
Refactor OTIO frame range collection #1060
Conversation
- Removed unused function import. - Added detailed logging for data updates. - Streamlined frame range calculations and handling. - Introduced a new class for collecting source frame ranges. - Improved readability by cleaning up code structure.
Task linked: AY-7125 Advanced Editorial publish to AYON |
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.
I gave it a try through Hiero and confirmed it still all works perfectly.
My only concern would be implementation-wise, currently it does:
Collect OTIO Frame Ranges [resolve, hiero, flame, traypublisher]:
* frameStart
* frameEnd
* clipIn
* clipOut
* clipInH
* clipOutH
then
Collect OTIO Frame Ranges (with media range) [hiero, flame]:
* frameStart (same value)
* frameEnd (retimed or same value)
* clipIn (same value)
* clipOut (same value)
* clipInH (same value)
* clipOutH (same value)
* sourceStart
* sourceEnd
* sourceStartH
* sourceEndH
I feel like there is quite some code duplication but more importantly to keep a single source of truth, I'd rather prefer to have :
Collect OTIO Frame Ranges [resolve, hiero, flame, traypublisher]:
* frameStart
* frameEnd
* clipIn
* clipOut
* clipInH
* clipOutH
then
Collect Source OTIO Frame Ranges [hiero, flame]:
* sourceStart
* sourceEnd
* sourceStartH
* sourceEndH
and
Collect Retimed OTIO Frame Ranges [hiero, flame]:
* frameEnd (if retimed)
What do you think ?
I would like to avoid hosts filtering completelly if possible, but that would probably require more changes.... |
- Added validation function for OTIO clips. - Improved documentation for each plugin. - Enhanced logging to provide clearer debug messages. - Separated logic for collecting timeline, source, and retimed ranges into distinct classes. - Updated frame calculations to handle retimed clips more effectively.
- Removed type hints for `Any` in function definitions. - Simplified the `validate_otio_clip` and `process` methods across multiple classes. - Cleaned up code for better readability without changing functionality.
try: | ||
import opentimelineio as otio | ||
except ImportError: | ||
raise RuntimeError("OpenTimelineIO is not installed.") |
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.
This will cause that the plugin won't be loaded at all. So artist even doesn't know it failed, and he's missing "maybe" important logic.
BTW if it would be kept why to raise RuntimeError
instead of keeping ImportError
without try > except?
label = "Collect Source OTIO Frame Ranges" | ||
order = pyblish.api.CollectorOrder - 0.07 | ||
families = ["shot", "clip"] | ||
hosts = ["hiero", "flame"] |
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.
Shouldn't we stop using product types for filtering and use different family instead? That would move responsibility of running the plugin to host integration, which makes it easily expandable to other hosts when needed, without need to change ayon-core
.
self.log.debug(f"Added source ranges: {pformat(data)}") | ||
|
||
|
||
class CollectOtioRetimedRanges(pyblish.api.InstancePlugin): |
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.
There are plugins CollectOtioFrameRanges
, CollectOtioSourceRanges
, CollectOtioRetimedRanges
, is there reason why it's 3 plugins instead of one? From what I see in the code, 1 plugin could be 1 method...
Changelog Description
Additional info
Testing notes:
All should work as before
Blocking ynput/ayon-traypublisher#58