@@ -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,18 @@ 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
+ """Remove all effects from the input timelines. The inputs are modified
514
+ in place, and also returned."""
515
+ for timeline in timelines :
516
+ # Items have an effects attribute, but other Composables do not.
517
+ # (e.g. Transitions) so we need to find only Items.
518
+ for item in timeline .find_children (descended_from_type = otio .core .Item ):
519
+ # Clear the effects list contents
520
+ item .effects [:] = []
521
+ return timelines
522
+
523
+
504
524
def _filter (item , names , patterns ):
505
525
"""This is a helper function that returns the input item if
506
526
its name matches the list of names given (if any), or matches any of the
0 commit comments