@@ -65,6 +65,9 @@ def main():
65
65
if args .remove_transitions :
66
66
timelines = filter_transitions (timelines )
67
67
68
+ if args .remove_effects :
69
+ timelines = filter_effects (timelines )
70
+
68
71
if args .only_tracks_with_name or args .only_tracks_with_index :
69
72
timelines = filter_tracks (
70
73
args .only_tracks_with_name ,
@@ -184,10 +187,10 @@ def parse_arguments():
184
187
185
188
2. Filtering
186
189
Options such as --video-only, --audio-only, --only-tracks-with-name,
187
- -only-tracks-with-index, --only-clips-with-name,
188
- --only-clips-with-name-regex, --remove-transitions, and --trim will remove
189
- content. Only the tracks, clips, etc. that pass all of the filtering options
190
- provided are passed to the next phase.
190
+ -- only-tracks-with-index, --only-clips-with-name,
191
+ --only-clips-with-name-regex, --remove-transitions, -- remove-effects and
192
+ --trim will remove content. Only the tracks, clips, etc. that pass all of
193
+ the filtering options provided are passed to the next phase.
191
194
192
195
3. Combine
193
196
If specified, the --stack, --concat, and --flatten operations are
@@ -295,6 +298,11 @@ def parse_arguments():
295
298
action = 'store_true' ,
296
299
help = "Remove all transitions"
297
300
)
301
+ parser .add_argument (
302
+ "--remove-effects" ,
303
+ action = 'store_true' ,
304
+ help = "Remove all effects"
305
+ )
298
306
parser .add_argument (
299
307
"--trim" ,
300
308
"-t" ,
@@ -501,6 +509,16 @@ def _f(item):
501
509
return [otio .algorithms .filtered_composition (t , _f ) for t in timelines ]
502
510
503
511
512
+ def filter_effects (timelines ):
513
+ """Return a copy of the input timelines with all effects removed.
514
+ The overall duration of the timelines should not be affected, with
515
+ the possible exception of time warp effects, which are also removed."""
516
+ for timeline in timelines :
517
+ for item in timeline .find_children ():
518
+ item .effects [:] = []
519
+ return timelines
520
+
521
+
504
522
def _filter (item , names , patterns ):
505
523
"""This is a helper function that returns the input item if
506
524
its name matches the list of names given (if any), or matches any of the
0 commit comments