Commit: 2ce2bffc4d8fd153494dad28d71511b7429e9a73 Author: Philipp Oeser Date: Tue Dec 21 13:42:08 2021 +0100 Branches: master https://developer.blender.org/rB2ce2bffc4d8fd153494dad28d71511b7429e9a73
Fix T94295: VSE fades error when no suitable sequences selected This errored out in two scenarios: - current frame not in strips framerange (this was reported) - no strips selected at all Now handle these cases properly in the operator and give appropriate report info. Maniphest Tasks: T94295 Differential Revision: https://developer.blender.org/D13642 =================================================================== M release/scripts/startup/bl_operators/sequencer.py =================================================================== diff --git a/release/scripts/startup/bl_operators/sequencer.py b/release/scripts/startup/bl_operators/sequencer.py index 26f1c12d2b8..1a56e77b7b7 100644 --- a/release/scripts/startup/bl_operators/sequencer.py +++ b/release/scripts/startup/bl_operators/sequencer.py @@ -216,11 +216,19 @@ class SequencerFadesAdd(Operator): scene.animation_data.action = action sequences = context.selected_sequences + + if not sequences: + self.report({'ERROR'}, "No sequences selected") + return {'CANCELLED'} + if self.type in {'CURSOR_TO', 'CURSOR_FROM'}: sequences = [ strip for strip in sequences if strip.frame_final_start < scene.frame_current < strip.frame_final_end ] + if not sequences: + self.report({'ERROR'}, "Current frame not within strip framerange") + return {'CANCELLED'} max_duration = min(sequences, key=lambda strip: strip.frame_final_duration).frame_final_duration max_duration = floor(max_duration / 2.0) if self.type == 'IN_OUT' else max_duration _______________________________________________ Bf-blender-cvs mailing list [email protected] List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
