Cleanup: VSE effect relationship checking
Use `SEQ_relation_is_effect_of_strip` for checking effect-input relationship where this is applicable.
This commit is contained in:
parent
502f3debf9
commit
0c3d2461b7
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "SEQ_channels.h"
|
||||
#include "SEQ_iterator.h"
|
||||
#include "SEQ_relations.h"
|
||||
#include "SEQ_select.h"
|
||||
#include "SEQ_sequencer.h"
|
||||
#include "SEQ_time.h"
|
||||
|
@ -1920,7 +1921,7 @@ static bool select_grouped_effect(SeqCollection *strips,
|
|||
Sequence *seq;
|
||||
SEQ_ITERATOR_FOREACH (seq, strips) {
|
||||
if (SEQ_CHANNEL_CHECK(seq, channel) && (seq->type & SEQ_TYPE_EFFECT) &&
|
||||
ELEM(actseq, seq->seq1, seq->seq2, seq->seq3)) {
|
||||
SEQ_relation_is_effect_of_strip(seq, actseq) {
|
||||
effects[seq->type] = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "SEQ_channels.h"
|
||||
#include "SEQ_effects.h"
|
||||
#include "SEQ_iterator.h"
|
||||
#include "SEQ_relations.h"
|
||||
#include "SEQ_render.h"
|
||||
#include "SEQ_sequencer.h"
|
||||
|
||||
|
@ -102,8 +103,7 @@ static void query_strip_effects_fn(Sequence *seq_reference,
|
|||
|
||||
/* Find all strips connected to `seq_reference`. */
|
||||
LISTBASE_FOREACH (Sequence *, seq_test, seqbase) {
|
||||
if (seq_test->seq1 == seq_reference || seq_test->seq2 == seq_reference ||
|
||||
seq_test->seq3 == seq_reference) {
|
||||
if (SEQ_relation_is_effect_of_strip(seq_test, seq_reference)) {
|
||||
query_strip_effects_fn(seq_test, seqbase, collection);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue