[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17589] branches/animsys2/source/blender: AnimSys2: UserPref for Default Interpolation of newly created IPO-Curves

Joshua Leung aligorith at gmail.com
Thu Nov 27 00:50:42 CET 2008


Revision: 17589
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17589
Author:   aligorith
Date:     2008-11-27 00:50:42 +0100 (Thu, 27 Nov 2008)

Log Message:
-----------
AnimSys2: UserPref for Default Interpolation of newly created IPO-Curves

This setting can be found under 'Edit Methods'. By default, 'Bezier' interpolation is still used, but this can be changed to another option.

Modified Paths:
--------------
    branches/animsys2/source/blender/makesdna/DNA_userdef_types.h
    branches/animsys2/source/blender/src/editipo.c
    branches/animsys2/source/blender/src/keyframing.c
    branches/animsys2/source/blender/src/space.c
    branches/animsys2/source/blender/src/usiblender.c

Modified: branches/animsys2/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- branches/animsys2/source/blender/makesdna/DNA_userdef_types.h	2008-11-26 23:13:59 UTC (rev 17588)
+++ branches/animsys2/source/blender/makesdna/DNA_userdef_types.h	2008-11-26 23:50:42 UTC (rev 17589)
@@ -207,7 +207,7 @@
 	short smooth_viewtx;	/* miliseconds to spend spinning the view */
 	short glreslimit;
 	short ndof_pan, ndof_rotate;
-	short curssize, pad;
+	short curssize, ipo_new;
 //	char pad[8];
 	char versemaster[160];
 	char verseuser[160];

Modified: branches/animsys2/source/blender/src/editipo.c
===================================================================
--- branches/animsys2/source/blender/src/editipo.c	2008-11-26 23:13:59 UTC (rev 17588)
+++ branches/animsys2/source/blender/src/editipo.c	2008-11-26 23:50:42 UTC (rev 17589)
@@ -2043,6 +2043,7 @@
 		if ((icu==NULL) && (add)) {
 			icu= MEM_callocN(sizeof(IpoCurve), "ipocurve");
 			
+			/* set default settings */
 			icu->flag |= (IPO_VISIBLE|IPO_AUTO_HORIZ);
 			if (ipo->curve.first==NULL) 
 				icu->flag |= IPO_ACTIVE;	/* first one added active */
@@ -2052,8 +2053,13 @@
 			
 			set_icu_vars(icu);
 			
+			/* default curve interpolation - from userpref */
+			icu->ipo= U.ipo_new;
+			
+			/* add curve to IPO-block */
 			BLI_addtail(&ipo->curve, icu);
 			
+			/* special type-dependent stuff */
 			switch (GS(from->name)) {
 				case ID_SEQ: {
 					Sequence *seq= (Sequence *)from;

Modified: branches/animsys2/source/blender/src/keyframing.c
===================================================================
--- branches/animsys2/source/blender/src/keyframing.c	2008-11-26 23:13:59 UTC (rev 17588)
+++ branches/animsys2/source/blender/src/keyframing.c	2008-11-26 23:50:42 UTC (rev 17589)
@@ -185,7 +185,7 @@
 	 *	- keyframe to be added would replace one of the existing ones on bounds
 	 */
 	if ((arraylen <= 0) || (array == NULL)) {
-		printf("Warning: binarysearch_bezt_index encountered invalid array \n");
+		printf("Warning: binarysearch_bezt_index() encountered invalid array \n");
 		return 0;
 	}
 	else {
@@ -235,7 +235,7 @@
 	
 	/* print error if loop-limit exceeded */
 	if (loopbreaker == (maxloop-1)) {
-		printf("Error: binarysearch_bezt_index was taking too long \n");
+		printf("Error: binarysearch_bezt_index() was taking too long \n");
 		
 		// include debug info 
 		printf("\tround = %d: start = %d, end = %d, arraylen = %d \n", loopbreaker, start, end, arraylen);

Modified: branches/animsys2/source/blender/src/space.c
===================================================================
--- branches/animsys2/source/blender/src/space.c	2008-11-26 23:13:59 UTC (rev 17588)
+++ branches/animsys2/source/blender/src/space.c	2008-11-26 23:50:42 UTC (rev 17589)
@@ -3614,8 +3614,8 @@
 	uiBut *uibut;
 	static short cur_light=0;
 	float fac, col[3];
-	short xpos, ypos, ypostab,  buth, rspace, dx, y1, y2, y3, y4, y5, y6, y7;
-	short y2label, y3label, y4label, y5label, y6label, y7label;
+	short xpos, ypos, ypostab,  buth, rspace, dx, y1, y2, y3, y4, y5, y6, y7, y8;
+	short y2label, y3label, y4label, y5label, y6label, y7label, y8label;
 	short spref, mpref, lpref, smfileselbut;
 	short edgsp, midsp;
 	char naam[32];
@@ -3667,6 +3667,7 @@
 	y5 = ypos+4*(buth+rspace);
 	y6 = ypos+5*(buth+rspace);
 	y7 = ypos+6*(buth+rspace);
+	y8 = ypos+7*(buth+rspace);
 
 
 	y2label = y2-2;		/* adjustments to offset the labels down to align better */
@@ -3675,6 +3676,7 @@
 	y5label = y5-2;
 	y6label = y6-2;
 	y7label = y7-2;
+	y8label = y8-2;
 
 
 	/* set the color to blue and draw the main 'tab' controls */
@@ -4058,6 +4060,15 @@
 		uiBlockEndAlign(block);
 
 
+		uiDefBut(block, LABEL,0,"Default IPO Interpolation",
+			(xpos+(2*edgsp)+(2*mpref)+midsp),y8label,mpref,buth,
+			0, 0, 0, 0, 0, "");
+		uiDefButS(block, MENU, B_DRAWINFO, 
+						"Default IPO Interpolation %t|Constant%x0|Linear%x1|Bezier%x2", 
+						(xpos+edgsp+(2*mpref)+(2*midsp)),y7,mpref, buth, 
+						&(U.ipo_new), 0, 1, 0, 0, 
+						"Interpolation to use for newly added IPO-curves");
+		
 		uiDefBut(block, LABEL,0,"Auto Keyframe",
 			(xpos+(2*edgsp)+(2*mpref)+midsp),y6label,mpref,buth,
 			0, 0, 0, 0, 0, "");

Modified: branches/animsys2/source/blender/src/usiblender.c
===================================================================
--- branches/animsys2/source/blender/src/usiblender.c	2008-11-26 23:13:59 UTC (rev 17588)
+++ branches/animsys2/source/blender/src/usiblender.c	2008-11-26 23:50:42 UTC (rev 17589)
@@ -61,6 +61,7 @@
 #include "IMB_imbuf_types.h"
 #include "IMB_imbuf.h"
 
+#include "DNA_ipo_types.h"
 #include "DNA_object_types.h"
 #include "DNA_space_types.h"
 #include "DNA_userdef_types.h"
@@ -522,6 +523,9 @@
 		/* adjust grease-pencil distances */
 		U.gp_manhattendist= 1;
 		U.gp_euclideandist= 2;
+		
+		/* adjust default interpolation for new IPO-curves */
+		U.ipo_new= IPO_BEZ;
 	}
 
 	/* GL Texture Garbage Collection (variable abused above!) */





More information about the Bf-blender-cvs mailing list