diff options
author | Nathan Lovato <nathan@gdquest.com> | 2020-05-14 23:40:24 +0300 |
---|---|---|
committer | Nathan Lovato <nathan@gdquest.com> | 2020-05-14 23:40:24 +0300 |
commit | c9f09d722abbaeded92803fc8fbb3e286480b35e (patch) | |
tree | dc16b3524b860829515b9b34a45d4c87df8678be /power_sequencer/operators/swap_strips.py | |
parent | 3b7dd92024ac0ac2b58b3ef4e5cf7daee6dfdefb (diff) |
Power Sequencer: update to version 1.5, fix for Blender 2.83
This makes the add-on compatible with Blender 2.83 after renaming the cut operator to split.
The update brings mainly bug fixes and quality of life improvements.
Changelog: https://github.com/GDQuest/blender-power-sequencer/blob/master/CHANGELOG.md#power-sequencer-1
36 Commits: https://github.com/GDQuest/blender-power-sequencer/compare/1.4.0...fb55bc77cf31920ddfe6fd4342b11e53ac988c93
Diffstat (limited to 'power_sequencer/operators/swap_strips.py')
-rw-r--r-- | power_sequencer/operators/swap_strips.py | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/power_sequencer/operators/swap_strips.py b/power_sequencer/operators/swap_strips.py index 3eeb07c1..00c45107 100644 --- a/power_sequencer/operators/swap_strips.py +++ b/power_sequencer/operators/swap_strips.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2016-2019 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors +# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors # # This file is part of Power Sequencer. # @@ -57,6 +57,9 @@ class POWER_SEQUENCER_OT_swap_strips(bpy.types.Operator): return context.selected_sequences def execute(self, context): + if len(context.selected_sequences) != 2: + return {"CANCELLED"} + strip_1 = context.selected_sequences[0] if len(context.selected_sequences) == 1: strip_2 = self.find_closest_strip_vertical(context, strip_1, self.direction) @@ -229,19 +232,19 @@ class POWER_SEQUENCER_OT_swap_strips(bpy.types.Operator): return return max(strips_below, key=attrgetter("channel")) - def are_linked(self, strip_1, strip_2): - return ( - strip_1.frame_final_start == strip_2.frame_final_start - and strip_1.frame_final_end == strip_2.frame_final_end - ) + def are_linked(self, strip_1, strip_2): + return ( + strip_1.frame_final_start == strip_2.frame_final_start + and strip_1.frame_final_end == strip_2.frame_final_end + ) - def swap_with_effect(self, strip_1, strip_2): - effect_strip = strip_1 if hasattr(strip_1, "input_1") else strip_2 - other_strip = strip_1 if effect_strip != strip_1 else strip_2 + def swap_with_effect(self, strip_1, strip_2): + effect_strip = strip_1 if hasattr(strip_1, "input_1") else strip_2 + other_strip = strip_1 if effect_strip != strip_1 else strip_2 - effect_strip_channel = effect_strip.channel - other_strip_channel = other_strip.channel + effect_strip_channel = effect_strip.channel + other_strip_channel = other_strip.channel - effect_strip.channel -= 1 - other_strip.channel = effect_strip_channel - effect_strip.channel = other_strip_channel + effect_strip.channel -= 1 + other_strip.channel = effect_strip_channel + effect_strip.channel = other_strip_channel |