-
Notifications
You must be signed in to change notification settings - Fork 314
Per-Track and Per-Clip Color #1887
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
Per-Track and Per-Clip Color #1887
Conversation
|
Code-wise, this looks great. I think this work will align nicely with the #1873 work as you pointed out. I have a couple of higher level design/spec questions:
|
I think that would be fine, if we're already planning to add color-coding to all kinds of
Definitely in Davinci Resolve, can't confirm for others. I don't know how that data is saved, but that may be irrelevant with intermediary formats. But that's partially the goal for the to and from functions, to resolve any formatting differences.
The original ticket mentions this information already in AAF and XML, but that's all I know of. I wasn't planning on contributing directly to the adapters, but I can help if they need it. |
|
I took a couple screenshots showing how NLEs handle clip and track color. Avid Media ComposerYou can do track and clip color in Media Composer a few different ways with some swatches or a picker. DaVinci ResolveResolve allows users to change track and clip color from the same pre-defined list. NukeStudioNot really an NLE, but NukeStudio allows users to change clip color using a color picker and recent swatches. While track color can change in the UI, it only happens as a result of changing a track's blend mode. Users can't pick individual colors for a track in the GUI nor via the Python API. Final Cut ProFCP changes clip color when you assign a Role to it. When creating Roles, you do have the option to choose from a swatch of predefined colors. |
|
Thanks! This is very helpful. Seeing how some of these colors map to/from "roles" or other concepts like "offline" "proxy" etc... do we need a way for OTIO to carry those in addition to the RGB color? Thinking out loud for a moment... if OTIO stored a color as |
I worry of cases where adapters/apps/devs only change one but not the other, or more specifically, where one is completely ignored for the other. Could lead to cases throwing the label and its RGBA value out of alignment. Since |
|
I added the Note that I put the name and metadata arguments at the end of the arg list so users could just define RGBA values without defining a name (it just defaults to "Color"). I figured that convenience might be easier when constructing colors, but let me know if you'd prefer otherwise. |
|
Thanks for trying out that change! Let me see if I can get a couple of other people to take a look at this change. My thoughts at the moment are:
|
darbyjohnston
left a comment
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.
Hi, and thanks for the changes! I just left a couple of comments about the C++ code.
|
Added updates. And once approved, I'll squash the commits and resolve conflicts afterwards. |
918ee4d to
bae2163
Compare
|
Notes for myself based on the meeting today:
|
f596e9b to
5ee2efb
Compare
|
WIP on moving But the changes so far can at least give you a sense of the design. |
efb57dc to
5de265f
Compare
|
Tests are failing since all the schemas are now changed. Is the intent to make this a hard API change? Ideally it would only be saved/written to the file if provided at all. I'm not familiar with updating schemas. |
|
Here's where the low-level types like Box2d are serialized:
When you update a schema, the test baseline needs to be updated to match. I think there's a script or Makefile target which handles that. Let me find someone who remembers the details... |
|
I haven't done it myself, but it looks like there is some documentation on updating the schema here: @rogernelson I think you made some schema changes with the spatial coordinates feature, do you have any tips? Edit: This is the spatial coordinates PR which made some schema changes for reference: |
src/py-opentimelineio/opentimelineio-bindings/otio_bindings.cpp
Outdated
Show resolved
Hide resolved
|
Hmm... I see one of the CI builds is failing with |
|
@jminor The Windows/MSYS2 build has been broken for awhile now, I'm not sure what the issue is. My personal preference would be to disable it, it seems to break periodically and I'm not sure we have the resources to support it. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1887 +/- ##
==========================================
+ Coverage 84.11% 84.62% +0.50%
==========================================
Files 198 181 -17
Lines 22241 13051 -9190
Branches 4687 1206 -3481
==========================================
- Hits 18709 11044 -7665
+ Misses 2610 1821 -789
+ Partials 922 186 -736
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 119 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
Thanks for investigating the build failure @darbyjohnston - it looks like that CI task is passing now. @semagnum can you update this branch with the latest changes from main (rebase or merge)? We will squash the commits when this PR merges. Almost landed! |
Signed-off-by: Spencer Magnusson <[email protected]>
Signed-off-by: Spencer Magnusson <[email protected]>
|
Thanks @jminor ! Just rebased the changes. |
I think all of those notes were addressed.
|
Thanks @semagnum ! |








Fixes #1614
Summarize your change.
Allow colors to be assigned per track and clip for organizational and tagging purposes. This change contains minimal API changes (colors are optional on both clip and track schemas). This work was part of ASWF Dev Days, thanks for the opportunity!
The new
Colorclass with Python bindings also includes:Marker::Colorfor reference)Reference associated tests.
tests/baselines/empty_clip.jsonto compensate for new color entrytest_color.pytest fileseem to beare passing on my end :)To Discuss
Coloruses doubles to play nice with the serializer since it does not support reading/writing floats. While the extra precision won't hurt anything, some may find it more reasonable to be stored as floats (in which case, we'd need to find a reliable way to support converting to/from doubles for the serializer). As Nick mentioned on Slack, OTIO doesn't have a standard regarding float precision and roundtripping of values. I added a docstring for the pybind's docstring to only expect accuracy within 1/255 of the intended value.Marker::Colorrelying on string names instead of values (see Marker RGB colors #1873). Since integrating there would require a more drastic API change (not to mention more rigorous testing), I figured it was beyond scope. But future API changes and adapters should definitely take advantage of this class.from_float_list()andto_float_list()since Python does not differentiate between floats and doubles just for clarity. But let me know if you'd prefer to usedoublein the name, or have it be different between Python and C++.