[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34728] trunk/blender/source/blender/ blenkernel/intern/ipo.c: Old animation conversion code cleanups:

Joshua Leung aligorith at gmail.com
Wed Feb 9 02:16:12 CET 2011


Revision: 34728
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34728
Author:   aligorith
Date:     2011-02-09 01:16:11 +0000 (Wed, 09 Feb 2011)
Log Message:
-----------
Old animation conversion code cleanups:
- Tidying up some inconsistent formatting
- Names of old IPO blocks are now included in the names used for new
actions. These are included after a "CDA:" prefix, (i.e.  "_C_onverted
_D_ata _A_ction:"), which makes it easier to browse through these
actions later.

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

Modified: trunk/blender/source/blender/blenkernel/intern/ipo.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/ipo.c	2011-02-09 01:05:40 UTC (rev 34727)
+++ trunk/blender/source/blender/blenkernel/intern/ipo.c	2011-02-09 01:16:11 UTC (rev 34728)
@@ -709,6 +709,11 @@
 			*array_index= 1; return "stars.color";
 		case WO_STAR_B:
 			*array_index= 2; return "stars.color"; */
+		case WO_STAR_R:
+		case WO_STAR_G:
+		case WO_STAR_B:
+			printf("WARNING: WO_STAR_R/G/B deprecated\n");
+			return NULL;
 		
 		case WO_STARDIST:
 			return "stars.min_distance";
@@ -798,7 +803,7 @@
  *		- array_index			- index in property's array (if applicable) to use
  *		- return				- the allocated path...
  */
-static char *get_rna_access (int blocktype, int adrcode, char actname[], char constname[], Sequence * seq, int *array_index)
+static char *get_rna_access (int blocktype, int adrcode, char actname[], char constname[], Sequence *seq, int *array_index)
 {
 	DynStr *path= BLI_dynstr_new();
 	const char *propname=NULL;
@@ -932,8 +937,7 @@
 	}
 	else if (seq) {
 		/* Sequence names in Scene */
-		sprintf(buf, "sequence_editor.sequences_all[\"%s\"]", 
-			seq->name+2);
+		sprintf(buf, "sequence_editor.sequences_all[\"%s\"]", seq->name+2);
 	}
 	else
 		strcpy(buf, ""); /* empty string */
@@ -1330,20 +1334,17 @@
 					}
 				}
 				
-				/* correct values for sequencer curves,
-				   that were not locked to frame */
-
-				if (seq && 
-				    (seq->flag & SEQ_IPO_FRAME_LOCKED) == 0) {
+				/* correct values for sequencer curves, that were not locked to frame */
+				if (seq && (seq->flag & SEQ_IPO_FRAME_LOCKED) == 0) {
 					double mul= (seq->enddisp-seq->startdisp)/100.0f;
 					double offset= seq->startdisp;
 					
 					dst->vec[0][0] *= mul;
 					dst->vec[0][0] += offset;
-
+					
 					dst->vec[1][0] *= mul;
 					dst->vec[1][0] += offset;
-
+					
 					dst->vec[2][0] *= mul;
 					dst->vec[2][0] += offset;
 				}
@@ -1490,7 +1491,7 @@
  * This assumes that AnimData has been added already. Separation of drivers
  * from animation data is accomplished here too...
  */
-static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[], Sequence * seq)
+static void ipo_to_animdata (ID *id, Ipo *ipo, char actname[], char constname[], Sequence *seq)
 {
 	AnimData *adt= BKE_animdata_from_id(id);
 	ListBase anim = {NULL, NULL};
@@ -1521,8 +1522,12 @@
 		if (G.f & G_DEBUG) printf("\thas anim \n");
 		/* try to get action */
 		if (adt->action == NULL) {
-			adt->action= add_empty_action("ConvData_Action"); // XXX we need a better name for this
-			if (G.f & G_DEBUG) printf("\t\tadded new action \n");
+			char nameBuf[MAX_ID_NAME];
+			
+			BLI_snprintf(nameBuf, sizeof(nameBuf), "CDA:%s", ipo->id.name+2);
+			
+			adt->action= add_empty_action(nameBuf);
+			if (G.f & G_DEBUG) printf("\t\tadded new action - '%s' \n", nameBuf);
 		}
 		
 		/* add F-Curves to action */
@@ -1878,7 +1883,7 @@
 				   to different DNA variables later 
 				   (semi-hack (tm) )
 				*/
-				switch(seq->type) {
+				switch (seq->type) {
 					case SEQ_IMAGE:
 					case SEQ_META:
 					case SEQ_SCENE:




More information about the Bf-blender-cvs mailing list