[Bf-blender-cvs] [47e88345a15] master: VSE: Fix animation duplication in split operator

Richard Antalik noreply at git.blender.org
Thu May 20 01:28:00 CEST 2021


Commit: 47e88345a154d2bd14bde57227e3efad7d1fff52
Author: Richard Antalik
Date:   Thu May 20 01:19:32 2021 +0200
Branches: master
https://developer.blender.org/rB47e88345a154d2bd14bde57227e3efad7d1fff52

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.

===================================================================

M	source/blender/sequencer/intern/strip_edit.c

===================================================================

diff --git a/source/blender/sequencer/intern/strip_edit.c b/source/blender/sequencer/intern/strip_edit.c
index 18f99272ee7..4de6ec3583c 100644
--- a/source/blender/sequencer/intern/strip_edit.c
+++ b/source/blender/sequencer/intern/strip_edit.c
@@ -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;



More information about the Bf-blender-cvs mailing list