Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Lovato <nathan@gdquest.com>2020-05-14 23:40:24 +0300
committerNathan Lovato <nathan@gdquest.com>2020-05-14 23:40:24 +0300
commitc9f09d722abbaeded92803fc8fbb3e286480b35e (patch)
treedc16b3524b860829515b9b34a45d4c87df8678be /power_sequencer/operators/trim_to_surrounding_cuts.py
parent3b7dd92024ac0ac2b58b3ef4e5cf7daee6dfdefb (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/trim_to_surrounding_cuts.py')
-rw-r--r--power_sequencer/operators/trim_to_surrounding_cuts.py41
1 files changed, 5 insertions, 36 deletions
diff --git a/power_sequencer/operators/trim_to_surrounding_cuts.py b/power_sequencer/operators/trim_to_surrounding_cuts.py
index 0d4c012b..15982393 100644
--- a/power_sequencer/operators/trim_to_surrounding_cuts.py
+++ b/power_sequencer/operators/trim_to_surrounding_cuts.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.
#
@@ -22,7 +22,7 @@ import bpy
from .utils.functions import convert_duration_to_frames, trim_strips
from .utils.doc import doc_name, doc_idname, doc_brief, doc_description
-from .utils.functions import find_closest_surrounding_cuts_frames
+from .utils.functions import find_closest_surrounding_cuts_frames, find_strips_in_range
class POWER_SEQUENCER_OT_trim_to_surrounding_cuts(bpy.types.Operator):
@@ -87,7 +87,9 @@ class POWER_SEQUENCER_OT_trim_to_surrounding_cuts(bpy.types.Operator):
)
return {"CANCELLED"}
- to_delete, to_trim = self.find_strips_in_range(context, left_cut_frame, right_cut_frame)
+ to_delete, to_trim = find_strips_in_range(
+ left_cut_frame, right_cut_frame, context.sequences
+ )
trim_start, trim_end = (left_cut_frame + margin_frame, right_cut_frame - margin_frame)
trim_strips(context, trim_start, trim_end, to_trim, to_delete)
@@ -100,36 +102,3 @@ class POWER_SEQUENCER_OT_trim_to_surrounding_cuts(bpy.types.Operator):
context.scene.frame_current = trim_start
return {"FINISHED"}
-
- def find_strips_in_range(
- self, context, start_frame, end_frame, sequences=[], find_overlapping=True
- ):
- """
- Returns strips which start and end within a certain frame range, or that overlap a
- certain frame range
- Args:
- - start_frame, the start of the frame range
- - end_frame, the end of the frame range
- - sequences (optional): only work with these sequences.
- If it doesn't receive any, the function works with all the sequences in the current context
- - find_overlapping (optional): find and return a list of strips that overlap the
- frame range
-
- Returns a tuple of two lists:
- [0], strips entirely in the frame range
- [1], strips that only overlap the frame range
- """
- strips_in_range = []
- strips_overlapping_range = []
- sequences = sequences if sequences else context.sequences
- for s in sequences:
- if start_frame < s.frame_final_start <= end_frame:
- if start_frame <= s.frame_final_end < end_frame:
- strips_in_range.append(s)
- elif find_overlapping:
- strips_overlapping_range.append(s)
- elif find_overlapping and start_frame <= s.frame_final_end <= end_frame:
- strips_overlapping_range.append(s)
- if s.frame_final_start < start_frame and s.frame_final_end > end_frame:
- strips_overlapping_range.append(s)
- return strips_in_range, strips_overlapping_range