diff options
author | Richard Antalik <richardantalik@gmail.com> | 2022-04-21 02:57:55 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2022-04-21 03:01:10 +0300 |
commit | 0c3d2461b78839df9f6d5f358bd8bbf48881edde (patch) | |
tree | 748572d764865ebbbfdf1943539686c52367fe76 /source/blender/sequencer/intern | |
parent | 502f3debf9a683280d12a5fa19bf4b3a2e2731bf (diff) |
Cleanup: VSE effect relationship checking
Use `SEQ_relation_is_effect_of_strip` for checking effect-input
relationship where this is applicable.
Diffstat (limited to 'source/blender/sequencer/intern')
-rw-r--r-- | source/blender/sequencer/intern/iterator.c | 13 | ||||
-rw-r--r-- | source/blender/sequencer/intern/strip_edit.c | 3 | ||||
-rw-r--r-- | source/blender/sequencer/intern/strip_relations.c | 2 |
3 files changed, 5 insertions, 13 deletions
diff --git a/source/blender/sequencer/intern/iterator.c b/source/blender/sequencer/intern/iterator.c index a4d8cf79d1f..2710edd6e80 100644 --- a/source/blender/sequencer/intern/iterator.c +++ b/source/blender/sequencer/intern/iterator.c @@ -20,6 +20,7 @@ #include "BKE_scene.h" #include "SEQ_iterator.h" +#include "SEQ_relations.h" #include "SEQ_render.h" #include "SEQ_time.h" #include "render.h" @@ -241,15 +242,6 @@ static void collection_filter_channel_up_to_incl(SeqCollection *collection, cons } } -static bool seq_is_effect_of(const Sequence *seq_effect, const Sequence *possibly_input) -{ - if (seq_effect->seq1 == possibly_input || seq_effect->seq2 == possibly_input || - seq_effect->seq3 == possibly_input) { - return true; - } - return false; -} - /* Check if seq must be rendered. This depends on whole stack in some cases, not only seq itself. * Order of applying these conditions is important. */ static bool must_render_strip(const Sequence *seq, SeqCollection *strips_at_timeline_frame) @@ -262,7 +254,8 @@ static bool must_render_strip(const Sequence *seq, SeqCollection *strips_at_time return false; } - if ((seq_iter->type & SEQ_TYPE_EFFECT) != 0 && seq_is_effect_of(seq_iter, seq)) { + if ((seq_iter->type & SEQ_TYPE_EFFECT) != 0 && + SEQ_relation_is_effect_of_strip(seq_iter, seq)) { /* Strips in same channel or higher than its effect are rendered. */ if (seq->machine >= seq_iter->machine) { return true; diff --git a/source/blender/sequencer/intern/strip_edit.c b/source/blender/sequencer/intern/strip_edit.c index 7aa81f5ae8a..6c7bb71cb75 100644 --- a/source/blender/sequencer/intern/strip_edit.c +++ b/source/blender/sequencer/intern/strip_edit.c @@ -154,8 +154,7 @@ static void sequencer_flag_users_for_removal(Scene *scene, ListBase *seqbase, Se } /* Remove effects, that use seq. */ - if ((user_seq->seq1 && user_seq->seq1 == seq) || (user_seq->seq2 && user_seq->seq2 == seq) || - (user_seq->seq3 && user_seq->seq3 == seq)) { + if (SEQ_relation_is_effect_of_strip(user_seq, seq)) { user_seq->flag |= SEQ_FLAG_DELETE; /* Strips can be used as mask even if not in same seqbase. */ sequencer_flag_users_for_removal(scene, &scene->ed->seqbase, user_seq); diff --git a/source/blender/sequencer/intern/strip_relations.c b/source/blender/sequencer/intern/strip_relations.c index ff6d9481f42..1899cc99263 100644 --- a/source/blender/sequencer/intern/strip_relations.c +++ b/source/blender/sequencer/intern/strip_relations.c @@ -42,7 +42,7 @@ bool SEQ_relation_is_effect_of_strip(const Sequence *effect, const Sequence *inp /* check whether sequence cur depends on seq */ static bool seq_relations_check_depend(Sequence *seq, Sequence *cur) { - if (cur->seq1 == seq || cur->seq2 == seq || cur->seq3 == seq) { + if (SEQ_relation_is_effect_of_strip(cur, seq)) { return true; } |