diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-04-20 12:51:43 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-04-20 12:51:43 +0300 |
commit | 9b4c8a25076fcba566997137140fd23166d52654 (patch) | |
tree | 728050a603f964220fb82dcdac60351982dfb0bc /source/blender | |
parent | 0aa2eed0c2e039b3ec69f15e306af212d51f2f5d (diff) |
Fix T44458 strip modifier mask not copied correctly when doing scene
copy.
What happens is that the strip is copied, but it still refers to the old
scene. Here we need to fix this by referring to the copy of the strip
and also do it after copying to make it order independent.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index 339432c2b77..535dcd6ba4d 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -5227,10 +5227,6 @@ static Sequence *seq_dupli(Scene *scene, Scene *scene_to, Sequence *seq, int dup MEM_dupallocN(seq->strip->stripdata); } else if (seq->type >= SEQ_TYPE_EFFECT) { - if (seq->seq1 && seq->seq1->tmp) seqn->seq1 = seq->seq1->tmp; - if (seq->seq2 && seq->seq2->tmp) seqn->seq2 = seq->seq2->tmp; - if (seq->seq3 && seq->seq3->tmp) seqn->seq3 = seq->seq3->tmp; - if (seq->type & SEQ_TYPE_EFFECT) { struct SeqEffectHandle sh; sh = BKE_sequence_get_effect(seq); @@ -5255,6 +5251,28 @@ static Sequence *seq_dupli(Scene *scene, Scene *scene_to, Sequence *seq, int dup return seqn; } +static void seq_new_fix_links_recursive(Sequence *seq) +{ + SequenceModifierData *smd; + + if (seq->type >= SEQ_TYPE_EFFECT) { + if (seq->seq1 && seq->seq1->tmp) seq->seq1 = seq->seq1->tmp; + if (seq->seq2 && seq->seq2->tmp) seq->seq2 = seq->seq2->tmp; + if (seq->seq3 && seq->seq3->tmp) seq->seq3 = seq->seq3->tmp; + } + else if (seq->type == SEQ_TYPE_META) { + Sequence *seqn; + for (seqn = seq->seqbase.first; seqn; seqn = seqn->next) { + seq_new_fix_links_recursive(seqn); + } + } + + for (smd = seq->modifiers.first; smd; smd = smd->next) { + if (smd->mask_sequence && smd->mask_sequence->tmp) + smd->mask_sequence = smd->mask_sequence->tmp; + } +} + Sequence *BKE_sequence_dupli_recursive(Scene *scene, Scene *scene_to, Sequence *seq, int dupe_flag) { Sequence *seqn = seq_dupli(scene, scene_to, seq, dupe_flag); @@ -5267,6 +5285,9 @@ Sequence *BKE_sequence_dupli_recursive(Scene *scene, Scene *scene_to, Sequence * } } } + + seq_new_fix_links_recursive(seqn); + return seqn; } @@ -5305,6 +5326,11 @@ void BKE_sequence_base_dupli_recursive( } } } + + /* fix modifier linking */ + for (seq = nseqbase->first; seq; seq = seq->next) { + seq_new_fix_links_recursive(seq); + } } /* called on draw, needs to be fast, |