Skip to content

Commit 9fb8fce

Browse files
committed
Reader: Fixed issue with markers not attaching due to Slot ID mismatch
Signed-off-by: Tim Lehr <[email protected]>
1 parent 2d3c1f3 commit 9fb8fce

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/otio_aaf_adapter/adapters/advanced_authoring_format.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ def _transcribe(item, parents, edit_rate, indent=0):
686686

687687
event_mob = event_mobs[-1]
688688

689-
metadata["AttachedSlotID"] = int(metadata["DescribedSlots"][0])
689+
metadata["AttachedSlotIds"] = [int(x) for x in metadata["DescribedSlots"]]
690690
metadata["AttachedPhysicalTrackNumber"] = int(
691691
event_mob["PhysicalTrackNumber"].value
692692
)
@@ -1248,17 +1248,21 @@ def _attach_markers(collection):
12481248
track_number = metadata.get("PhysicalTrackNumber")
12491249
if slot_id is None or track_number is None:
12501250
continue
1251-
12521251
tracks_map[(int(slot_id), int(track_number))] = track
12531252

12541253
# iterate all tracks for their markers and attach them to the matching item
12551254
for current_track in timeline.find_children(
12561255
descended_from_type=otio.schema.Track):
12571256
for marker in list(current_track.markers):
12581257
metadata = marker.metadata.get("AAF", {})
1259-
slot_id = metadata.get("AttachedSlotID")
1258+
attached_slot_ids = metadata.get("AttachedSlotIds", [])
1259+
12601260
track_number = metadata.get("AttachedPhysicalTrackNumber")
1261-
target_track = tracks_map.get((slot_id, track_number))
1261+
target_track = None
1262+
for slot_id in attached_slot_ids:
1263+
target_track = tracks_map.get((slot_id, track_number))
1264+
if target_track:
1265+
break
12621266

12631267
# remove marker from current parent track
12641268
current_track.markers.remove(marker)

0 commit comments

Comments
 (0)