VSE: Fix animation duplication in split operator

Due to misunderstanding of how strip duplication works, animation data
was duplicated on all strips when any strip was split.

`SEQ_sequence_base_dupli_recursive()` duplicated data on strip that was
being split, and `SEQ_ensure_unique_name()` duplicated animation on all
strips.

Only duplication should be done with `SEQ_ensure_unique_name()` and only
on right side split strips, because only these strips are duplicated.
This commit is contained in:
Richard Antalik 2021-05-20 01:19:32 +02:00
parent d1c9a99c07
commit 47e88345a1
Notes: blender-bot 2023-02-14 00:57:33 +01:00
Referenced by issue #88502, Blender crashing when opening by .blend or after open .blend file
Referenced by issue #77170, Mantaflow smoke preview will not update till domain settings are changed
1 changed files with 6 additions and 6 deletions

View File

@ -411,8 +411,7 @@ Sequence *SEQ_edit_strip_split(Main *bmain,
/* Duplicate ListBase. */
ListBase right_strips = {NULL, NULL};
SEQ_sequence_base_dupli_recursive(
scene, scene, &right_strips, &left_strips, SEQ_DUPE_ANIM | SEQ_DUPE_ALL, 0);
SEQ_sequence_base_dupli_recursive(scene, scene, &right_strips, &left_strips, SEQ_DUPE_ALL, 0);
/* Split strips. */
Sequence *left_seq = left_strips.first;
@ -424,11 +423,12 @@ Sequence *SEQ_edit_strip_split(Main *bmain,
right_seq = right_seq->next;
}
/* Move strips back to seqbase. Move right strips first, so left strips don't change name. */
BLI_movelisttolist(seqbase, &right_strips);
seq = right_strips.first;
BLI_movelisttolist(seqbase, &left_strips);
LISTBASE_FOREACH (Sequence *, seq_iter, seqbase) {
SEQ_ensure_unique_name(seq_iter, scene);
BLI_movelisttolist(seqbase, &right_strips);
for (; seq; seq = seq->next) {
SEQ_ensure_unique_name(seq, scene);
}
return return_seq;