OpenTimelineIO / otio-aaf-adapter

OpenTimelineIO Advanced Authoring Format (AAF) Adapter
Apache License 2.0
15 stars 6 forks source link

OpenTimelineIO raises exception when trying to load AAF exported from Avid with "Use Selected Tracks" selected #40

Closed austinwitherspoon closed 3 months ago

austinwitherspoon commented 4 months ago

Bug Report

I’ve found a bug in Avid Media Composer AAF file generation:

Currently OTIO will raise an exception when trying to load this AAF:

raise AAFAdapterError(
    "Marker '{}' cannot be attached to an item. SlotID: '{}', "
    "PhysicalTrackNumber: '{}'".format(
        marker.name, slot_id, track_number
    )
)

Since this is a "valid" aaf generated by Avid Media Composer, OpenTimelineIO shouldn't explode when reading in the file.

To Reproduce

Here's an AAF file generated by Avid Media Composer 2021.12.2.55649.0, using the instructions above: bad_marker_track_from_avid.aaf.zip

Logs

Traceback (most recent call last):
  File "/Users/awitherspoon/src/studio/otio-aaf-adapter/.venv/bin/otioview", line 8, in <module>
    sys.exit(main())
  File "/Users/awitherspoon/src/studio/otio-aaf-adapter/.venv/lib/python3.9/site-packages/opentimelineview/console.py", line 300, in main
    window.load(args.input)
  File "/Users/awitherspoon/src/studio/otio-aaf-adapter/.venv/lib/python3.9/site-packages/opentimelineview/console.py", line 191, in load
    file_contents = otio.adapters.read_from_file(
  File "/Users/awitherspoon/src/studio/otio-aaf-adapter/.venv/lib/python3.9/site-packages/opentimelineio/adapters/__init__.py", line 137, in read_from_file
    return adapter.read_from_file(
  File "/Users/awitherspoon/src/studio/otio-aaf-adapter/.venv/lib/python3.9/site-packages/opentimelineio/adapters/adapter.py", line 116, in read_from_file
    result = self._execute_function(
  File "/Users/awitherspoon/src/studio/otio-aaf-adapter/.venv/lib/python3.9/site-packages/opentimelineio/plugins/python_plugin.py", line 142, in _execute_function
    return (getattr(self.module(), func_name)(**kwargs))
  File "/Users/awitherspoon/src/studio/otio-aaf-adapter/src/otio_aaf_adapter/adapters/advanced_authoring_format.py", line 1609, in read_from_file
    result = _attach_markers(result)
  File "/Users/awitherspoon/src/studio/otio-aaf-adapter/src/otio_aaf_adapter/adapters/advanced_authoring_format.py", line 1259, in _attach_markers
    raise AAFAdapterError(
opentimelineio.adapters.AAF.AAFAdapterError: Marker 'Marker on Track 3! When exported with Track 2 deselected and exported with "Selected Tracks Only", this marker will incorrectly point at track 2 in the AAF even though it doesn't exist (since the original track 2 was ommitted, and track 3 was renamed to 2 by avid!)' cannot be attached to an item. SlotID: '9', PhysicalTrackNumber: '3'