diff options
Diffstat (limited to 'power_sequencer/operators/utils')
-rw-r--r-- | power_sequencer/operators/utils/__init__.py | 4 | ||||
-rw-r--r-- | power_sequencer/operators/utils/doc.py | 5 | ||||
-rw-r--r-- | power_sequencer/operators/utils/draw.py | 5 | ||||
-rw-r--r-- | power_sequencer/operators/utils/functions.py | 31 | ||||
-rw-r--r-- | power_sequencer/operators/utils/global_settings.py | 5 | ||||
-rw-r--r-- | power_sequencer/operators/utils/info_progress_bar.py | 5 |
6 files changed, 23 insertions, 32 deletions
diff --git a/power_sequencer/operators/utils/__init__.py b/power_sequencer/operators/utils/__init__.py index 71fca8c4..be8d8b53 100644 --- a/power_sequencer/operators/utils/__init__.py +++ b/power_sequencer/operators/utils/__init__.py @@ -1,4 +1,2 @@ # SPDX-License-Identifier: GPL-3.0-or-later -# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors - -# This file is part of Power Sequencer. +# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors diff --git a/power_sequencer/operators/utils/doc.py b/power_sequencer/operators/utils/doc.py index 8bdae410..be52c7c2 100644 --- a/power_sequencer/operators/utils/doc.py +++ b/power_sequencer/operators/utils/doc.py @@ -1,8 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors - -# This file is part of Power Sequencer. - +# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors """ Utilities to convert operator names and docstrings to human-readable text. Used to generate names for Blender's operator search, and to generate Power Sequencer's documentation. diff --git a/power_sequencer/operators/utils/draw.py b/power_sequencer/operators/utils/draw.py index 5a156bea..3cede778 100644 --- a/power_sequencer/operators/utils/draw.py +++ b/power_sequencer/operators/utils/draw.py @@ -1,8 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors - -# This file is part of Power Sequencer. - +# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors """Drawing utilities. A list of functions to draw common elements""" # import bgl import blf diff --git a/power_sequencer/operators/utils/functions.py b/power_sequencer/operators/utils/functions.py index 0d5c9fcf..c4552c2d 100644 --- a/power_sequencer/operators/utils/functions.py +++ b/power_sequencer/operators/utils/functions.py @@ -1,8 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors - -# This file is part of Power Sequencer. - +# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors from math import floor, sqrt from operator import attrgetter @@ -279,9 +276,7 @@ def trim_strips(context, frame_start, frame_end, to_trim, to_delete=[]): elif s.frame_final_end > trim_start and s.frame_final_start < trim_start: s.frame_final_end = trim_start - for s in to_delete: - bpy.context.sequences.remove(s) - + delete_strips(to_delete) for s in initial_selection: s.select = True return {"FINISHED"} @@ -331,7 +326,8 @@ def get_sequences_under_cursor(context): def ripple_move(context, sequences, duration_frames, delete=False): - """Moves sequences in the list and ripples the change to all sequences after them, in the corresponding channels + """ + Moves sequences in the list and ripples the change to all sequences after them, in the corresponding channels The `duration_frames` can be positive or negative. If `delete` is True, deletes every sequence in `sequences`. """ @@ -344,10 +340,7 @@ def ripple_move(context, sequences, duration_frames, delete=False): ] if delete: - bpy.ops.sequencer.select_all(action="DESELECT") - for s in sequences: - s.select = True - bpy.ops.sequencer.delete() + delete_strips(sequences) else: to_ripple = set(to_ripple + sequences) @@ -390,8 +383,20 @@ def find_strips_in_range(frame_start, frame_end, sequences, find_overlapping=Tru return strips_inside_range, strips_overlapping_range +def delete_strips(to_delete): + """ + Deletes the list of sequences `to_delete` + """ + # Effect strips get deleted with their source so we skip them to avoid errors. + to_delete = [s for s in to_delete if s.type in SequenceTypes.CUTABLE] + sequences = bpy.context.scene.sequence_editor.sequences + for s in to_delete: + sequences.remove(s) + + def move_selection(context, sequences, frame_offset, channel_offset=0): - """Offsets the selected `sequences` horizontally and vertically and preserves + """ + Offsets the selected `sequences` horizontally and vertically and preserves the current selected sequences. """ if not sequences: diff --git a/power_sequencer/operators/utils/global_settings.py b/power_sequencer/operators/utils/global_settings.py index a5c9756b..6c5ed55a 100644 --- a/power_sequencer/operators/utils/global_settings.py +++ b/power_sequencer/operators/utils/global_settings.py @@ -1,8 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors - -# This file is part of Power Sequencer. - +# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors class ProjectSettings: RESOLUTION_X = 1920 RESOLUTION_Y = 1080 diff --git a/power_sequencer/operators/utils/info_progress_bar.py b/power_sequencer/operators/utils/info_progress_bar.py index e645c762..e479aecf 100644 --- a/power_sequencer/operators/utils/info_progress_bar.py +++ b/power_sequencer/operators/utils/info_progress_bar.py @@ -1,8 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -# Copyright 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors - -# This file is part of Power Sequencer. - +# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors import bpy |