diff options
author | Dalai Felinto <dalai@blender.org> | 2021-09-28 11:33:42 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2021-09-28 11:44:39 +0300 |
commit | e5ff9f3615dec3ad8701e404bb4f57e758f71032 (patch) | |
tree | 8e12b87ad8560d1193bdc0988cb0fe34daba09c6 /source | |
parent | a64782b1334118d1bd98c78f665e7e0bfd232076 (diff) |
Cleanup: Move VSE channels check into own util function
Differential Revision: https://developer.blender.org/D12661
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 2 | ||||
-rw-r--r-- | source/blender/sequencer/SEQ_sequencer.h | 1 | ||||
-rw-r--r-- | source/blender/sequencer/intern/sequencer.c | 12 | ||||
-rw-r--r-- | source/blender/sequencer/intern/strip_transform.c | 2 |
4 files changed, 15 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 1dd7fcf1d1a..03f19cef94e 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -997,7 +997,7 @@ static void link_recurs_seq(BlendDataReader *reader, ListBase *lb) LISTBASE_FOREACH_MUTABLE (Sequence *, seq, lb) { /* Sanity check. */ - if ((seq->machine < 1) || (seq->machine > MAXSEQ)) { + if (!SEQ_valid_strip_channel(seq)) { BLI_freelinkN(lb, seq); BLO_read_data_reports(reader)->count.vse_strips_skipped++; } diff --git a/source/blender/sequencer/SEQ_sequencer.h b/source/blender/sequencer/SEQ_sequencer.h index 7e733817630..1b8982da0d2 100644 --- a/source/blender/sequencer/SEQ_sequencer.h +++ b/source/blender/sequencer/SEQ_sequencer.h @@ -89,6 +89,7 @@ void SEQ_sequence_base_dupli_recursive(const struct Scene *scene_src, const struct ListBase *seqbase, int dupe_flag, const int flag); +bool SEQ_valid_strip_channel(struct Sequence *seq); /* Read and Write functions for .blend file data */ void SEQ_blend_write(struct BlendWriter *writer, struct ListBase *seqbase); diff --git a/source/blender/sequencer/intern/sequencer.c b/source/blender/sequencer/intern/sequencer.c index 382bd51aae1..c164e7fc2ee 100644 --- a/source/blender/sequencer/intern/sequencer.c +++ b/source/blender/sequencer/intern/sequencer.c @@ -636,6 +636,18 @@ void SEQ_sequence_base_dupli_recursive(const Scene *scene_src, seq_new_fix_links_recursive(seq); } } + +bool SEQ_valid_strip_channel(Sequence *seq) +{ + if (seq->machine < 1) { + return false; + } + if (seq->machine > MAXSEQ) { + return false; + } + return true; +} + /* r_prefix + [" + escaped_name + "] + \0 */ #define SEQ_RNAPATH_MAXSTR ((30 + 2 + (SEQ_NAME_MAXSTR * 2) + 2) + 1) diff --git a/source/blender/sequencer/intern/strip_transform.c b/source/blender/sequencer/intern/strip_transform.c index d5ff455c694..54ca4ef487f 100644 --- a/source/blender/sequencer/intern/strip_transform.c +++ b/source/blender/sequencer/intern/strip_transform.c @@ -278,7 +278,7 @@ bool SEQ_transform_seqbase_shuffle_ex(ListBase *seqbasep, SEQ_time_update_sequence(evil_scene, test); } - if ((test->machine < 1) || (test->machine > MAXSEQ)) { + if (!SEQ_valid_strip_channel(test)) { /* Blender 2.4x would remove the strip. * nicer to move it to the end */ |