[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20658] trunk/blender/source/blender/src/ editseq.c: Fix "duplicate strip" always increase the user count for ipo.

Diego Borghetti bdiego at gmail.com
Fri Jun 5 18:54:06 CEST 2009


Revision: 20658
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20658
Author:   bdiego
Date:     2009-06-05 18:54:06 +0200 (Fri, 05 Jun 2009)

Log Message:
-----------
Fix "duplicate strip" always increase the user count for ipo.

As venomgfx point, the shift+d function never duplicate the ipo block
if we have enable the option in UserDef -> Edit Methods -> Ipo.

Now, if Ipo option is disable, we just increase the user count, otherwise
we duplicate the ipo.

Note: Alighorith, we need call ipo_idnew here ? (like single_ipo_users)

Modified Paths:
--------------
    trunk/blender/source/blender/src/editseq.c

Modified: trunk/blender/source/blender/src/editseq.c
===================================================================
--- trunk/blender/source/blender/src/editseq.c	2009-06-05 16:53:21 UTC (rev 20657)
+++ trunk/blender/source/blender/src/editseq.c	2009-06-05 16:54:06 UTC (rev 20658)
@@ -68,6 +68,7 @@
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_scene.h"
+#include "BKE_ipo.h"
 
 #include "BIF_space.h"
 #include "BIF_interface.h"
@@ -2243,12 +2244,30 @@
 static Sequence *dupli_seq(Sequence *seq) 
 {
 	Sequence *seqn = MEM_dupallocN(seq);
+	ID *id;
 
 	seq->tmp = seqn;
 		
 	seqn->strip= MEM_dupallocN(seq->strip);
 
-	if(seqn->ipo) seqn->ipo->id.us++;
+	if (seqn->ipo) {
+		if (U.dupflag & USER_DUP_IPO) {
+			id= (ID *)seqn->ipo;
+			seqn->ipo= copy_ipo(seqn->ipo);
+			/* we don't need to decrease the number
+			 * of the ipo because we never increase it,
+			 * for example, adduplicate need decrease
+			 * the number but only because copy_object
+			 * call id_us_plus for the ipo block and
+			 * single_ipo_users only work if id->us > 1.
+			 *
+			 * need call ipo_idnew here, for drivers ??
+			 * - Diego
+			 */
+		}
+		else
+			seqn->ipo->id.us++;
+	}
 
 	seqn->strip->tstripdata = 0;
 	seqn->strip->tstripdata_startstill = 0;





More information about the Bf-blender-cvs mailing list