Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_operators/sequencer.py
| Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | class SequencerFadesClear(Operator): | ||||
| bl_label = "Clear Fades" | bl_label = "Clear Fades" | ||||
| bl_options = {'REGISTER', 'UNDO'} | bl_options = {'REGISTER', 'UNDO'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip | return context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip | ||||
| def execute(self, context): | def execute(self, context): | ||||
| fcurves = context.scene.animation_data.action.fcurves | animation_data = context.scene.animation_data | ||||
| if animation_data is None: | |||||
| return {'CANCELLED'} | |||||
| action = animation_data.action | |||||
| if action is None: | |||||
| return {'CANCELLED'} | |||||
| fcurves = action.fcurves | |||||
| fcurve_map = { | fcurve_map = { | ||||
| curve.data_path: curve | curve.data_path: curve | ||||
| for curve in fcurves | for curve in fcurves | ||||
| if curve.data_path.startswith("sequence_editor.sequences_all") | if curve.data_path.startswith("sequence_editor.sequences_all") | ||||
| } | } | ||||
| for sequence in context.selected_sequences: | for sequence in context.selected_sequences: | ||||
| animated_property = "volume" if hasattr(sequence, "volume") else "blend_alpha" | animated_property = "volume" if hasattr(sequence, "volume") else "blend_alpha" | ||||
| data_path = sequence.path_from_id() + "." + animated_property | data_path = sequence.path_from_id() + "." + animated_property | ||||
| ▲ Show 20 Lines • Show All 218 Lines • Show Last 20 Lines | |||||