diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-07-16 20:09:14 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-07-16 20:16:35 +0300 |
commit | 53743adc297f74752cd59fe97f8e72b0c8174c1c (patch) | |
tree | 85d721c75e5d55f03e3df4095751771c44d1a6db /release | |
parent | 1dcf0f9cf11808a9659b456a424a6ac5e04257e6 (diff) |
VSE: Fix multicam splitting all selected strips
`split_multicam` used split operator, where if more strips than
multicam were selected, all would be split, which is undesirable.
Add `Sequence.split()` RNA API function. to split individual strips.
Function accepts `frame` and `split_method arguments`. Returns right
strip after splitting.
In case when strip being split have effects, these will be split too, so
no invalid state should be created.
Selection is not handled, this is by design up to user.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D11926
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/startup/bl_operators/sequencer.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/release/scripts/startup/bl_operators/sequencer.py b/release/scripts/startup/bl_operators/sequencer.py index 48a02a4c5c6..8f678896e61 100644 --- a/release/scripts/startup/bl_operators/sequencer.py +++ b/release/scripts/startup/bl_operators/sequencer.py @@ -108,14 +108,13 @@ class SequencerSplitMulticam(Operator): if s.multicam_source == camera or camera >= s.channel: return {'FINISHED'} - if not s.select: - s.select = True - cfra = context.scene.frame_current - bpy.ops.sequencer.split(frame=cfra, type='SOFT', side='RIGHT') - for s in context.scene.sequence_editor.sequences_all: - if s.select and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end: - context.scene.sequence_editor.active_strip = s + right_strip = s.split(frame=cfra, split_method='SOFT') + + if right_strip: + s.select = False + right_strip.select = True + context.scene.sequence_editor.active_strip = right_strip context.scene.sequence_editor.active_strip.multicam_source = camera return {'FINISHED'} |