Skip to content

Commit 1bbc920

Browse files
committed
Filter clips
1 parent 6ff25de commit 1bbc920

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

auto_editor/exports/fcp11.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,10 @@
1-
from __future__ import annotations
2-
31
import xml.etree.ElementTree as ET
4-
from typing import TYPE_CHECKING, cast
2+
from fractions import Fraction
53
from xml.etree.ElementTree import Element, ElementTree, SubElement, indent
64

5+
from auto_editor.ffwrapper import FileInfo
76
from auto_editor.timeline import Clip, v3
8-
9-
if TYPE_CHECKING:
10-
from fractions import Fraction
11-
12-
from auto_editor.ffwrapper import FileInfo
13-
from auto_editor.utils.log import Log
14-
7+
from auto_editor.utils.log import Log
158

169
"""
1710
Export a FCPXML 11 file readable with Final Cut Pro 10.6.8 or later.
@@ -146,7 +139,7 @@ def make_clip(ref: str, clip: Clip) -> None:
146139
)
147140

148141
if tl.v and tl.v[0]:
149-
clips = cast(list[Clip], tl.v[0])
142+
clips = [clip for clip in tl.v[0] if isinstance(clip, Clip)]
150143
elif tl.a and tl.a[0]:
151144
clips = tl.a[0]
152145
else:

auto_editor/exports/shotcut.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import xml.etree.ElementTree as ET
2-
from typing import cast
32

43
from auto_editor.timeline import Clip, v3
54
from auto_editor.utils.func import aspect_ratio, to_timecode
@@ -71,7 +70,7 @@ def shotcut_write_mlt(output: str, tl: v3) -> None:
7170
producers = 0
7271

7372
if tl.v:
74-
clips = cast(list[Clip], tl.v[0])
73+
clips = [clip for clip in tl.v[0] if isinstance(clip, Clip)]
7574
elif tl.a:
7675
clips = tl.a[0]
7776
else:

0 commit comments

Comments
 (0)