pyaaf2 icon indicating copy to clipboard operation
pyaaf2 copied to clipboard

Add support for walking a Selector.

Open jminor opened this issue 6 years ago • 10 comments

jminor avatar Feb 20 '19 19:02 jminor

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?

jminor avatar Feb 20 '19 19:02 jminor

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

markreidvfx avatar Feb 20 '19 22:02 markreidvfx

I'm not sure if it should yield itself, I have a much messier one that I use, will take a look at it

markreidvfx avatar Feb 20 '19 22:02 markreidvfx

Hi @markreidvfx do you have any more guidance on this?

jminor avatar Mar 04 '19 23:03 jminor

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.

markreidvfx avatar Mar 06 '19 04:03 markreidvfx

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.

jminor avatar Apr 05 '19 00:04 jminor

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?

markreidvfx avatar Apr 08 '19 03:04 markreidvfx

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.

emcodem avatar Oct 14 '19 08:10 emcodem

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.

jminor avatar Dec 11 '19 20:12 jminor

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.

jminor avatar Nov 22 '21 20:11 jminor