-
Notifications
You must be signed in to change notification settings - Fork 289
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
Add enabled flag to Item #1175
Add enabled flag to Item #1175
Conversation
- Adds the enabled flag as well as get and set methods. - Adds Python bindings. - Add .otio read and write code.
9e33ec2
to
0d9c6bd
Compare
0327ed2
to
b3a5cab
Compare
Adds enabled to constructor in both Python and C++ Also updates the tests a bit more
This is looking great. It would be nice to have a simple unit test which toggles the enabled boolean and ensures that it loads/saves correctly. |
Oops, I pressed the "Ready for Review" button which made this no longer a "draft" PR. I meant to do that to a different PR. I'm not sure how to undo that... |
Should the term "enabled" be documented so that the semantic around it are clear? Like what does this field do and how should it be used? It's the in proposal but I feel like it could potentially be documented in OTIO directly. Opinions? |
We'd talked about adding |
Agree. There are a bunch of algorithms that potentially interact with this. Questions:
|
I think all of those questions are answered by "a disabled Item behaves just like a Gap." In more detail:
Yes, just like a Gap. Toggling the enable/disable state of an Item should not change the duration of that Item, nor anything else on the Track it lives in.
Transparently, just like a Gap.
Yes. When
Yes. It is up to the caller to decide what to do with disabled clips. We could consider offering a convenience to find only enabled clips.
No. Only Transitions are overlapping.
Nothing special. It works just like a Gap. |
The default for the flag for any item is enabled = true. Structures in most languages default initialize elements to zero. Would it make sense to have an opposite sense flag as the default? For example, "omitted", might be a word that communicates the flag intention better, and has a zero default? Or maybe "is_gap" would answer all of Stephan's questions immediately without searching documentation, while also being a zero default? The documentation could then clarify that the difference between Gap and Item::is_gap == true is that this is intended as a way to make a placeholder, or omitted item behave as a gap without losing its authored information? |
We have plenty of other things that initialize to non-zero values (e.g RationalTime's rate) and I think we should prioritize semantic clarity over implementation details. |
omitted doesn't really carry the idea that it still is part of the timing of the composition. Just chewing on the semantics of "enabled" a little more... The only thing that still makes me a bit squirmy, is that the information carried within an item includes whether or not it's visible. In other respects, enabled==false just means that the item does not compose visually or audibly. The core information about the clip being visible seems a property of the clip. If it's meaning changes according to enabled, we can't ask a clip if it's intended to be visible, without first enabling it. If the flatten algorithm asked about .... (edit) I guess that's moot. visible() is an implementation detail that is not serializable, and whose implementation could currently be rewritten as I had had it in my mind that visible was authorable qualia. |
Thanks for all the feedback. I'll try and reply to all the points here. Unit Tests Should I just add a new method to Should I also extend the other Adapter support I'm happy to have a go at adding an adapter but if I get bogged down in it I'll move it to another PR. Documentation I don't see any harm in adding some documentation, where would be the best place for it? Effect I'll add Transitions Algorithms Would flatten be a good place to start with these? General Questions
|
Timelines have a lot of use cases. When talking about |
As discussed in the TSC meeting, ImageSequenceReference has some good examples about how to add documentation to properties in the python bindings, see here. |
In response to the question of whether or not to add |
Thanks. Just to clarify would you leave |
I don't have strong a strong opinion about the |
Okay I'll leave it for now then. |
Codecov Report
@@ Coverage Diff @@
## main #1175 +/- ##
==========================================
- Coverage 86.21% 86.14% -0.08%
==========================================
Files 191 191
Lines 19047 19279 +232
Branches 2104 2295 +191
==========================================
+ Hits 16422 16607 +185
- Misses 2079 2117 +38
- Partials 546 555 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
With regards hierarchical enabling, consider this scenario:
Now consider if clips are according to track, all clips are enable=false
Now all clips are enable=true we've lost information from step 2 So I'd say the enable flag is a compositional information, not an explict datum. In other words, if a track is enabled=false, then the composition of the track should not be evaluated. |
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'm approving, with a tweak suggested to the docstring. Code LGTM.
I'm also requesting a second approval due to the size of the diff.
src/py-opentimelineio/opentimelineio-bindings/otio_serializableObjects.cpp
Outdated
Show resolved
Hide resolved
Thanks, I've implemented the change in the latest commit. R.e. the hierarchical enabling I see what you mean yes, however in |
otioview is indeed view only :) |
This is looking really good, and seems to be almost complete. I have two questions:
|
We discussed the questions from my previous comment in yesterday's OTIO TSC meeting. We decided that the For the schema versioning question, we decided to not increment the Item schema version number since the new |
Thanks for the contribution @ThomasWilshaw ! This is a great improvement for OTIO and you did an excellent job of working with the community to make this PR very clean & robust. |
- Adds the enabled property to Item as well as get and set methods. - Adds Python bindings. - Add support for enabled property when serializing/deserializing. - Add enabled support to CMX 3600 for clips and tracks - otioview: grey out disabled clips & tracks - Update flatten algorithm to respect enabled and add tests - Update sample OTIO files to include enabled keyword
Fixes #1102
Updates the schema to add an
enabled
flag toItem
. Proposal can be seen here. Any comments or suggestions are very welcome.