Skip to content

Commit

Permalink
Kdenlive adapter: process recent project format (#1191)
Browse files Browse the repository at this point in the history
Fixes #1159 in collaboration with #1160
  • Loading branch information
vpinon authored Feb 7, 2022
1 parent 7ac9c1b commit 2035d38
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contrib/opentimelineio_contrib/adapters/kdenlive.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ def read_from_string(input_str):
name=mlt.get('name', 'Kdenlive imported timeline'))

maintractor = mlt.find("tractor[@global_feed='1']")
# global_feed is no longer set in newer kdenlive versions
if maintractor is None:
alltractors = mlt.findall("tractor")
# the last tractor is the main tractor
maintractor = alltractors[-1]
# check all other tractors are used as tracks
for tractor in alltractors[:-1]:
if maintractor.find("track[@producer='%s']" % tractor.attrib['id']) is None:
raise RuntimeError("Can't find main tractor")

for maintrack in maintractor.findall('track'):
if maintrack.get('producer') == 'black_track':
continue
Expand Down

0 comments on commit 2035d38

Please sign in to comment.