diff options
author | Richard Antalik <richardantalik@gmail.com> | 2020-04-27 00:35:56 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2020-04-27 00:40:18 +0300 |
commit | dea1c1b9eb4378bcf4d2f097f3b90a90076f8edd (patch) | |
tree | 1327935f5dfe16862d412b19be1f3e97b927bec3 /source/blender | |
parent | 05b94c9c5457ac119f52fa9db6e41a218b64c477 (diff) |
Fix T75495: Blender crashes opening a VSE .blend file
During scene copy modifier mask strips are relinked to point to strips in
new scene. If strip used as mask is in different seqbase, this can fail,
if seqbase is not copied yet.
Add SEQ_DUPE_IS_RECURSIVE_CALL flag to avoid relinking modifiers during recursive call.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D7412
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 9268fdf1391..939fcb33b2d 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -496,6 +496,7 @@ typedef struct SeqLoadInfo { #define SEQ_DUPE_CONTEXT (1 << 1) #define SEQ_DUPE_ANIM (1 << 2) #define SEQ_DUPE_ALL (1 << 3) /* otherwise only selected are copied */ +#define SEQ_DUPE_IS_RECURSIVE_CALL (1 << 4) /* use as an api function */ typedef struct Sequence *(*SeqLoadFn)(struct bContext *, ListBase *, struct SeqLoadInfo *); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 93e5a3bbd74..d3d885fccd9 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -5818,7 +5818,7 @@ void BKE_sequence_base_dupli_recursive(const Scene *scene_src, Sequence *seqn = NULL; Sequence *last_seq = BKE_sequencer_active_get((Scene *)scene_src); /* always include meta's strips */ - int dupe_flag_recursive = dupe_flag | SEQ_DUPE_ALL; + int dupe_flag_recursive = dupe_flag | SEQ_DUPE_ALL | SEQ_DUPE_IS_RECURSIVE_CALL; for (seq = seqbase->first; seq; seq = seq->next) { seq->tmp = NULL; @@ -5844,6 +5844,12 @@ void BKE_sequence_base_dupli_recursive(const Scene *scene_src, } } + /* Fix modifier links recursively from the top level only, when all sequences have been + * copied. */ + if (dupe_flag & SEQ_DUPE_IS_RECURSIVE_CALL) { + return; + } + /* fix modifier linking */ for (seq = nseqbase->first; seq; seq = seq->next) { seq_new_fix_links_recursive(seq); |