-
Notifications
You must be signed in to change notification settings - Fork 36
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
Resolve: mediapool loader and inventory clearing plugins #140
Resolve: mediapool loader and inventory clearing plugins #140
Conversation
…r setting the resulting bin as the current folder. Add iter_all_media_pool_clips function to recursively iterate all media pool clips in the current project. Introduce RemoveUnusedMedia inventory action plugin to remove unused media pool items and LoadMedia loader plugin for loading media into Resolve. adaptation from BigRoy/OpenPype@37da9c6#diff-3ec58869aa5ff3f62216d417256778fd5b44ea0132b953e67d7880f5e7b53df5
…rences, and adjust track index handling in find_clip_usage function.
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.
Thanks for transferring the logic into a PR. Here are some notes to keep in mind.
# Get the start and end frame of the image sequence, incl. handles | ||
frame_start = version["data"].get("frameStart", 0) | ||
frame_end = version["data"].get("frameEnd", 0) | ||
handle_start = version["data"].get("handleStart", 0) | ||
handle_end = version["data"].get("handleEnd", 0) | ||
frame_start_handle = frame_start - handle_start | ||
frame_end_handle = frame_end + handle_end | ||
padding = len(representation["context"].get("frame")) |
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've heard of cases where a particular representation might have differing frame ranges than the version data (e.g. slates added, etc.) and as such this MIGHT be incorrect for some edge cases. We might need to at some point store those ranges in representation["data"]
so we can reliably get frame ranges per representation instead.
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 is good point for the new Representation model @antirotor is working on.
Added a list of metadata items for clip properties. Refactored setting clip metadata based on context.
- Refactored clip color variables - Updated media pool bin path template - Modified metadata mapping structure for LoadMedia plugin
This wont load the same product if its already in the timeline. Do you mean we should remove it first? |
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.
Remove Unused Media (inventory)
This does not work atm. The duplicated clip is not removed.
Could you show what happens for you? |
There is an option box on the Load Media loader - in there you can disable "re-use existing" - when disabled this should load the media pool item another extra time into the media pool instead of continuing to use the existing media pool item of this version that you had loaded previously. Note however: there are certain file types that I loaded where Resolve just seemed incapable of loading it again (I believe exr sequence?) even though I'm explicitly requesting there API to load it again. In those cases, the logic to 'not re-use, load again' will likely fail and actually continue to re-use since Resolve API just doesn't want to load it again into the same Media Pool Folder. Also, during testing I'd recommend having the Resolve "console" open to debug whether the python scripts spew out any errors at all. |
those are addressed in #92
Could you confirm there are no logs in Console in regards of removing? Here is a video on how it works on myside and where to look for logging. Untitled.mov |
@jakubjezek001 I think you just submitted your comment too early before the file finished uploading. 🌪️ |
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.
load again but this case use loader option box and disable add to Timeline
I cant get the media
to load a second time. I've tried disabling the Re-use existing
option, but it does not bring in any extra clip.
select any item in manager and RMB click
Looks like you need to select at least the group of containers with unused media in it. Maybe this action should either be fixed so you can select any item in the manager or entry to the tool should be somewhere else than the manager?
What type of media are you loading? A sequence or video file? What extension? I've had this a few times where Resolve just didn't want to load it again but it only occurred with certain files. That's the note I mentioned there. I didn't investigate too much as to why that happens exactly.
Any inventory action only runs over the entries you've selected in the manager - so yes. It would only clear from your selection. |
EXR sequence, so maybe this is the issue you are referring to. Maybe we can warn the user at least about the non-existent functionality of EXRs?
Yeah, question is what makes sense to the user? |
We have the same in Maya "Remove unused looks" which also removes only from the selected containers so might be that we were just familiar with that 'workflow'. However there if you were to run |
Sounds good to me. |
Would be good to: |
…ancement/AY-2612-resolve-adaptation-colorbleed-plugins # Conflicts: # server_addon/resolve/client/ayon_resolve/plugins/load/load_media.py
- Renamed resolve paths for media pool items - Updated imports for media loading functionality
…ns' into enhancement/AY-2612-resolve-adaptation-colorbleed-plugins
Deleted unused subproject integration for Unreal Engine.
…ation-colorbleed-plugins Resolve: mediapool loader and inventory clearing plugins
Bumped up the version number from 0.2.1 to 0.2.2 in the package.py file for DaVinci Resolve addon.
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.
Changes look good to me. :)
Update the addon version from 0.2.1 to 0.2.2 in the codebase.
- Refactored file path handling for importing media. - Updated method to determine if the file is a sequence. - Improved handling of frame numbers in file paths.
Extracted media import logic to a separate method for clarity. The new method handles importing media to Resolve Media Pool and creating bins if necessary.
@jakubjezek001 could you let me know what the conditions are to test this fix since I had tested both sequences and video files just fine before that. I want to make sure I run through what's needed there. The code seems quite "involved" for something that should be trivial - so I'm hoping to find a way better than this madness. |
There was bug in the code, for some reason sequences were not loading at all for me until the fix. Also I wanted to make sure frame range is taken from real frames rather then from version data. Here is the traceback from image sequences before:
|
For what it's worth - seemed to work fine on my end also with the changes. Thanks! |
Changelog Description
Adding plugin for loading into mediapool with option to also add into timeline. Inventory plugin for clearing timeline item container included unused media's from mediapool. Clips in mediapool are colormanaged via remapping.
Additional info
Following changes are adaptation from Colorbleed's code BigRoy/OpenPype@37da9c6#diff-3ec58869aa5ff3f62216d417256778fd5b44ea0132b953e67d7880f5e7b53df5. Thanks @BigRoy
The fix dealing with Adjustment Clips on timeline which was originally here were moved into #92.
Next steps
Testing notes:
Load media (loader)
Load media
plugin and load anythingadd to Timeline
Remove Unused Media (inventory)
Remove Unused Media