[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30077] trunk/blender/source/blender/ blenkernel/intern/sequencer.c: dont swap strip names when swapping strips, means they keep their fcurves

Campbell Barton ideasman42 at gmail.com
Wed Jul 7 15:14:52 CEST 2010


Revision: 30077
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30077
Author:   campbellbarton
Date:     2010-07-07 15:14:51 +0200 (Wed, 07 Jul 2010)

Log Message:
-----------
dont swap strip names when swapping strips, means they keep their fcurves

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/sequencer.c

Modified: trunk/blender/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/sequencer.c	2010-07-07 12:50:24 UTC (rev 30076)
+++ trunk/blender/source/blender/blenkernel/intern/sequencer.c	2010-07-07 13:14:51 UTC (rev 30077)
@@ -3799,6 +3799,8 @@
 
 int seq_swap(Sequence *seq_a, Sequence *seq_b)
 {
+	char name[sizeof(seq_a->name)];
+
 	if(seq_a->len != seq_b->len)
 		return 0;
 
@@ -3807,12 +3809,33 @@
 		if(seq_a->type == SEQ_SOUND || seq_b->type == SEQ_SOUND) {
 			return 0;
 		}
+
+		/* disallow effects to swap with non-effects strips */
+		if((seq_a->type & SEQ_EFFECT) != (seq_b->type & SEQ_EFFECT)) {
+			return 0;
+		}
+
+		if((seq_a->type & SEQ_EFFECT) && (seq_b->type & SEQ_EFFECT)) {
+			if(get_sequence_effect_num_inputs(seq_a->type) != get_sequence_effect_num_inputs(seq_b->type)) {
+				return 0;
+			}
+		}
 	}
 
 	SWAP(Sequence, *seq_a, *seq_b);
+
+	/* swap back names so animation fcurves dont get swapped */
+	strcpy(name, seq_a->name+2);
+	strcpy(seq_a->name+2, seq_b->name+2);
+	strcpy(seq_b->name+2, name);
+
+	/* swap back opacity, and overlay mode */
+	SWAP(int, seq_a->blend_mode, seq_b->blend_mode);
+	SWAP(float, seq_a->blend_opacity, seq_b->blend_opacity);
+
+
 	SWAP(void *, seq_a->prev, seq_b->prev);
 	SWAP(void *, seq_a->next, seq_b->next);
-
 	SWAP(int, seq_a->start, seq_b->start);
 	SWAP(int, seq_a->startofs, seq_b->startofs);
 	SWAP(int, seq_a->endofs, seq_b->endofs);





More information about the Bf-blender-cvs mailing list