Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/py-opentimelineio/opentimelineio/adapters/cmx_3600.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,13 @@ def _expand_transitions(timeline):
clip = next_clip
next_clip = next(track_iter, None)
continue
if transition_type not in ['D']:

wipe_match = re.match(r'W(\d{3})', transition_type)
if wipe_match is not None:
otio_transition_type = "SMPTE_Wipe"
elif transition_type in ['D']:
otio_transition_type = schema.TransitionTypes.SMPTE_Dissolve
else:
raise EDLParseError(
"Transition type '{}' not supported by the CMX EDL reader "
"currently.".format(transition_type)
Expand Down Expand Up @@ -704,8 +710,8 @@ def _expand_transitions(timeline):
new_trx = schema.Transition(
name=clip.name,
# only supported type at the moment
transition_type=schema.TransitionTypes.SMPTE_Dissolve,
metadata=clip.metadata
transition_type=otio_transition_type,
metadata=clip.metadata,
)
new_trx.in_offset = mid_tran_cut_pre_duration
new_trx.out_offset = mid_tran_cut_post_duration
Expand Down
10 changes: 10 additions & 0 deletions tests/sample_data/wipe_test.edl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
TITLE: wipe test
FCM: NON-DROP FRAME
001 TST V C 01:00:04:05 01:00:04:14 01:00:00:00 01:00:00:09
* FROM CLIP NAME: clip_A
002 TST V C 01:00:04:14 01:00:04:14 01:00:00:09 01:00:00:09
002 TST V W001 010 01:00:08:08 01:00:08:18 01:00:00:09 01:00:00:19
* FROM CLIP NAME: clip_A
* TO CLIP NAME: clip_B
003 TST V C 01:00:08:18 01:00:08:19 01:00:00:19 01:00:00:20
* FROM CLIP NAME: clip_B
14 changes: 14 additions & 0 deletions tests/test_cmx_3600_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
DISSOLVE_TEST_2 = os.path.join(SAMPLE_DATA_DIR, "dissolve_test_2.edl")
DISSOLVE_TEST_3 = os.path.join(SAMPLE_DATA_DIR, "dissolve_test_3.edl")
GAP_TEST = os.path.join(SAMPLE_DATA_DIR, "gap_test.edl")
WIPE_TEST = os.path.join(SAMPLE_DATA_DIR, "wipe_test.edl")
TIMECODE_MISMATCH_TEST = os.path.join(SAMPLE_DATA_DIR, "timecode_mismatch.edl")
SPEED_EFFECTS_TEST = os.path.join(SAMPLE_DATA_DIR, "speed_effects.edl")
SPEED_EFFECTS_TEST_SMALL = os.path.join(
Expand Down Expand Up @@ -444,6 +445,19 @@ def test_dissolve_with_odd_frame_count_maintains_length(self):
# VALIDATE
self.assertEqual(tl.duration().value, (11 * 24) + 12)

def test_wipe_parse(self):
tl = otio.adapters.read_from_file(WIPE_TEST)
self.assertEqual(len(tl.tracks[0]), 3)

wipe = tl.tracks[0][1]
self.assertTrue(isinstance(wipe, otio.schema.Transition))

self.assertEqual(wipe.transition_type, "SMPTE_Wipe")
self.assertEqual(wipe.metadata["cmx_3600"]["transition"], "W001")

self.assertEqual(tl.tracks[0][0].duration().value, 14)
self.assertEqual(tl.tracks[0][2].duration().value, 6)

def test_fade_to_black_ends_with_gap(self):
# EXERCISE
tl = otio.adapters.read_from_string(
Expand Down