diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-02-11 22:18:02 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-02-11 22:20:36 +0300 |
commit | 27b2ab8cf4ae9140ff53d812c142e7d65cbeee11 (patch) | |
tree | 867c540862befafc239b6160245ae7cb71400286 /source/blender/blenkernel/intern/sequencer.c | |
parent | 26d7ac507763100efa5a544730813d13139a6f84 (diff) |
Fix VSE strip channel skip overlapping strips
D1096 by @mangostaniko (with some edits)
Diffstat (limited to 'source/blender/blenkernel/intern/sequencer.c')
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 83287fe7725..cb23b1eb88e 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -3764,21 +3764,23 @@ Sequence *BKE_sequencer_foreground_frame_get(Scene *scene, int frame) } /* return 0 if there werent enough space */ -bool BKE_sequence_base_shuffle(ListBase *seqbasep, Sequence *test, Scene *evil_scene) +bool BKE_sequence_base_shuffle_ex(ListBase *seqbasep, Sequence *test, Scene *evil_scene, int channel_delta) { - int orig_machine = test->machine; - test->machine++; + const int orig_machine = test->machine; + BLI_assert(ELEM(channel_delta, -1, 1)); + + test->machine += channel_delta; BKE_sequence_calc(evil_scene, test); - while (BKE_sequence_test_overlap(seqbasep, test) ) { - if (test->machine >= MAXSEQ) { + while (BKE_sequence_test_overlap(seqbasep, test)) { + if ((channel_delta > 0) ? (test->machine >= MAXSEQ) : (test->machine <= 1)) { break; } - test->machine++; + + test->machine += channel_delta; BKE_sequence_calc(evil_scene, test); // XXX - I don't think this is needed since were only moving vertically, Campbell. } - - if (test->machine >= MAXSEQ) { + if ((test->machine < 1) || (test->machine > MAXSEQ)) { /* Blender 2.4x would remove the strip. * nicer to move it to the end */ @@ -3802,6 +3804,11 @@ bool BKE_sequence_base_shuffle(ListBase *seqbasep, Sequence *test, Scene *evil_s } } +bool BKE_sequence_base_shuffle(ListBase *seqbasep, Sequence *test, Scene *evil_scene) +{ + return BKE_sequence_base_shuffle_ex(seqbasep, test, evil_scene, 1); +} + static int shuffle_seq_time_offset_test(ListBase *seqbasep, char dir) { int offset = 0; |