Skip to content

Commit 3d1bde5

Browse files
committed
fixed timeline output bug and return empty timeline instead of None
1 parent 7949476 commit 3d1bde5

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/py-opentimelineio/opentimelineio/console/otiodiff/getDiff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def diffTimelines(timelineA, timelineB):
3636

3737
makeTimelineSummary(timelineA, timelineB)
3838

39-
outputTimeline = None
39+
outputTimeline = otio.schema.Timeline()
4040
# process video tracks, audio tracks, or both
4141
if hasVideo and hasAudio:
4242
videoClipTable = categorizeClipsByTracks(timelineA.video_tracks(), timelineB.video_tracks())

src/py-opentimelineio/opentimelineio/console/otiotool.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def main():
121121

122122
if args.diff:
123123
# TODO? stack, concat, diff make mutually exclusive
124-
diff_otio(timelines)
124+
timelines = [diff_otio(timelines)]
125125

126126
# Phase 6: Remove/Redaction
127127

@@ -510,8 +510,6 @@ def read_inputs(input_paths):
510510
timelines.append(timeline)
511511
return timelines
512512

513-
# ======= NEW =======
514-
515513
def diff_otio(timelines):
516514
# TODO: check file format of timelines for OTIO
517515
"""Return an annotated timeline showing how clips changed from the first to the second timeline"""
@@ -520,13 +518,7 @@ def diff_otio(timelines):
520518
if len(timelines) != 2:
521519
print("Warning: more than 2 timelines provided as input. Only the first two timelines will be diffed.")
522520
else:
523-
timelines = [getDiff.diffTimelines(timelines[0], timelines[1])]
524-
if len(timelines) == 0:
525-
print("No output timeline generated by diff")
526-
527-
return timelines
528-
529-
# ===================
521+
return getDiff.diffTimelines(timelines[0], timelines[1])
530522

531523
def keep_only_video_tracks(timeline):
532524
"""Remove all tracks except for video tracks from a timeline."""

0 commit comments

Comments
 (0)