@@ -65,6 +65,9 @@ def main():
6565 if args .remove_transitions :
6666 timelines = filter_transitions (timelines )
6767
68+ if args .remove_effects :
69+ timelines = filter_effects (timelines )
70+
6871 if args .only_tracks_with_name or args .only_tracks_with_index :
6972 timelines = filter_tracks (
7073 args .only_tracks_with_name ,
@@ -184,10 +187,10 @@ def parse_arguments():
184187
1851882. Filtering
186189 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.
191194
1921953. Combine
193196 If specified, the --stack, --concat, and --flatten operations are
@@ -295,6 +298,11 @@ def parse_arguments():
295298 action = 'store_true' ,
296299 help = "Remove all transitions"
297300 )
301+ parser .add_argument (
302+ "--remove-effects" ,
303+ action = 'store_true' ,
304+ help = "Remove all effects"
305+ )
298306 parser .add_argument (
299307 "--trim" ,
300308 "-t" ,
@@ -501,6 +509,18 @@ def _f(item):
501509 return [otio .algorithms .filtered_composition (t , _f ) for t in timelines ]
502510
503511
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+
504524def _filter (item , names , patterns ):
505525 """This is a helper function that returns the input item if
506526 its name matches the list of names given (if any), or matches any of the
0 commit comments