VSE: Reduce transform code complexity

Reduce complexity of sequencer transform code by removing recursivity.
This is possible by treating meta strips (mostly) as any other strip and
containing all transform code within SEQ_ functions.

Unfortunately internally meta strips still require special treatment,
but all complexity from code all over transform code seems to be
possible to contain within one function.

Functional change:
Previously adjusting handle of single image strip moved animation.
Now animation is not moved, which is behavior for all other strips.

Reviewed By: sergey, mano-wii

Differential Revision: https://developer.blender.org/D11493
This commit is contained in:
2021-06-17 03:40:44 +02:00
parent c73be23e17
commit e7003bc965
7 changed files with 141 additions and 257 deletions

View File

@@ -335,7 +335,7 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
/* Check meta-strips. */
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT && !(seq->depth == 0 && seq->flag & SEQ_LOCK) &&
if (seq->flag & SELECT && !(seq->flag & SEQ_LOCK) &&
SEQ_transform_sequence_can_be_translated(seq)) {
if ((seq->flag & (SEQ_LEFTSEL + SEQ_RIGHTSEL)) == 0) {
SEQ_transform_translate_sequence(
@@ -357,7 +357,7 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
/* Test for effects and overlap. */
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT && !(seq->depth == 0 && seq->flag & SEQ_LOCK)) {
if (seq->flag & SELECT && !(seq->flag & SEQ_LOCK)) {
seq->flag &= ~SEQ_OVERLAP;
if (SEQ_transform_test_overlap(ed->seqbasep, seq)) {
SEQ_transform_seqbase_shuffle(ed->seqbasep, seq, scene);
@@ -2187,7 +2187,7 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i
seq = ed->seqbasep->first;
while (seq) {
if ((seq != test) && (test->machine == seq->machine) && (test->depth == seq->depth) &&
if ((seq != test) && (test->machine == seq->machine) &&
((sel == -1) || (sel == (seq->flag & SELECT)))) {
dist = MAXFRAME * 2;