pyaaf2
pyaaf2 copied to clipboard
Add support for walking a Selector.
I'm slightly confused about why all of the walk() logic is inside the SourceClip class. Is that how you intended it @markreidvfx ? Also, should a Selector yield itself, in addition to the selected and alternate segments?
Selector should yield itself and selected (it's a avid groupclip). Walk was supposed to walk the reference chain until it hits a null reference, so it doesn't make sense to me to yield the alternatives.
Walk is only there I think because initially I didn't know where to put it. It could be on the base segment class I guess. Then each subclass could override. it also should eventually have a time argument.
The property helpers should also return value of the property self['Selected'].value
I'm not sure if it should yield itself, I have a much messier one that I use, will take a look at it
Hi @markreidvfx do you have any more guidance on this?
Sorry been a bit swamped and didn't had much time. But I just looked at my messier implementation and I just yield Selector['Selected'].value
. so no, it should not yield itself and alternate segments.
I updated this to put walk()
on the Segment class with overrides for each supported subclass. Can you see if I'm on the right track?
Do you see this as expanding the whole tree, or just a slice (via the time parameter)? I am a little unclear on the intent of the component_at_time
part.
It suppose to be just a slice. I've only been using it to find source timecode, but we can make it walk to whole structure if thats what you need? can you add a test?
Dear Mark, is there any issue with this left? It would be cool if this would work as the great opentimelineio project (or their aaf support) is somehow depending on it.
FYI, we talked about this in an OpenTimelineIO meeting today. We will investigate more to see if this is the right path forward. It does seem to work in practice for some example AAFs, but the intent of walk
here in pyaaf2 is to drill down on a specific frame, while OTIO wants a general traversal of the whole AAF. This is different enough that we should probably implement it with a different mechanism.
FYI, I have a better solution to this in OTIO which does not involve modifying pyaaf2. I will close this old PR once that solution has landed in OTIO.