diff options
author | Nathan Lovato <nathan@gdquest.com> | 2021-01-24 03:17:35 +0300 |
---|---|---|
committer | Nathan Lovato <nathan@gdquest.com> | 2021-01-24 03:17:35 +0300 |
commit | cd176b2617bd3ede969c3aa218ee54a79fc69f27 (patch) | |
tree | b4f51b2c46a95f1ebb8a001269cd8ae6f417bf2a /power_sequencer/operators/snap_selection.py | |
parent | b482ca0078d5640306985f478bb1dec3dbe7219b (diff) |
Update power sequencer to v2.0.1
Changelog: https://github.com/GDQuest/blender-power-sequencer/blob/master/CHANGELOG.md#power-sequencer-201
Commit range: https://github.com/GDQuest/blender-power-sequencer/compare/1.5.0...2.0.1
Diffstat (limited to 'power_sequencer/operators/snap_selection.py')
-rw-r--r-- | power_sequencer/operators/snap_selection.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/power_sequencer/operators/snap_selection.py b/power_sequencer/operators/snap_selection.py index 5900579b..eb2851b5 100644 --- a/power_sequencer/operators/snap_selection.py +++ b/power_sequencer/operators/snap_selection.py @@ -15,7 +15,7 @@ # not, see <https://www.gnu.org/licenses/>. # import bpy -from .utils.functions import get_sequences_under_cursor, apply_time_offset +from .utils.functions import get_sequences_under_cursor, move_selection from .utils.doc import doc_name, doc_idname, doc_brief, doc_description @@ -32,11 +32,7 @@ class POWER_SEQUENCER_OT_snap_selection(bpy.types.Operator): "demo": "", "description": doc_description(__doc__), "shortcuts": [ - ( - {"type": "S", "value": "PRESS", "alt": True}, - {}, - "Snap selection to cursor", - ) + ({"type": "S", "value": "PRESS", "alt": True}, {}, "Snap selection to cursor",) ], "keymap": "Sequencer", } @@ -55,9 +51,7 @@ class POWER_SEQUENCER_OT_snap_selection(bpy.types.Operator): if context.selected_sequences else get_sequences_under_cursor(context) ) - frame_first = min( - sequences, key=lambda s: s.frame_final_start - ).frame_final_start + frame_first = min(sequences, key=lambda s: s.frame_final_start).frame_final_start time_offset = context.scene.frame_current - frame_first - apply_time_offset(context, sequences, time_offset) + move_selection(context, sequences, time_offset) return {"FINISHED"} |