[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13068] branches/animsys-aligorith/source/ blender: == AnimSys Branch - Assorted Changes ==

Joshua Leung aligorith at gmail.com
Mon Dec 31 00:34:23 CET 2007


Revision: 13068
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13068
Author:   aligorith
Date:     2007-12-31 00:34:23 +0100 (Mon, 31 Dec 2007)

Log Message:
-----------
== AnimSys Branch - Assorted Changes ==

Nothing new, just some fixes for various things...

Modified Paths:
--------------
    branches/animsys-aligorith/source/blender/blenkernel/intern/ipo.c
    branches/animsys-aligorith/source/blender/blenkernel/intern/nla.c
    branches/animsys-aligorith/source/blender/blenkernel/intern/scene.c
    branches/animsys-aligorith/source/blender/include/BIF_keyframing.h
    branches/animsys-aligorith/source/blender/makesdna/DNA_animdata_types.h
    branches/animsys-aligorith/source/blender/makesdna/DNA_nla_types.h
    branches/animsys-aligorith/source/blender/src/keyframing.c

Modified: branches/animsys-aligorith/source/blender/blenkernel/intern/ipo.c
===================================================================
--- branches/animsys-aligorith/source/blender/blenkernel/intern/ipo.c	2007-12-30 23:27:35 UTC (rev 13067)
+++ branches/animsys-aligorith/source/blender/blenkernel/intern/ipo.c	2007-12-30 23:34:23 UTC (rev 13068)
@@ -1556,7 +1556,7 @@
 
 /* This function applies animation data for pose channels. The only reason that
  * the standard function is not used, is that this function also sets the POSE_* 
- * flags as well (for loc, rot, size). Therefore, it is only really caleld from
+ * flags as well (for loc, rot, size). Therefore, it is only really called from
  * extract_pose_from_action.
  */
 void apply_poseanim_ipo (bActionChannel *achan, bPoseChannel *pchan)

Modified: branches/animsys-aligorith/source/blender/blenkernel/intern/nla.c
===================================================================
--- branches/animsys-aligorith/source/blender/blenkernel/intern/nla.c	2007-12-30 23:27:35 UTC (rev 13067)
+++ branches/animsys-aligorith/source/blender/blenkernel/intern/nla.c	2007-12-30 23:34:23 UTC (rev 13068)
@@ -227,7 +227,7 @@
 /* ---------------------- */
 
 /* evaluates the given evaluation strip */
-static void nlastrip_ctime_evaluate (bAnimData *adt, void *data, bNlaEvalStrip *nes, float ctime)
+static void nlastrip_ctime_evaluate (bAnimData *adt, void *data, bNlaEvalStrip *nes)
 {
 	
 }
@@ -283,7 +283,7 @@
 	}
 	
 	/* check if strip has been found (and whether it has data worth considering) */
-	if (ELEM3(NULL, astrip, astrip->ipo, astrip->act)) 
+	if (ELEM(NULL, astrip, astrip->act)) 
 		return;
 	if (astrip->flag & ACTSTRIP_MUTE) 
 		return;

Modified: branches/animsys-aligorith/source/blender/blenkernel/intern/scene.c
===================================================================
--- branches/animsys-aligorith/source/blender/blenkernel/intern/scene.c	2007-12-30 23:27:35 UTC (rev 13067)
+++ branches/animsys-aligorith/source/blender/blenkernel/intern/scene.c	2007-12-30 23:34:23 UTC (rev 13068)
@@ -565,7 +565,7 @@
 	framechange_poses_clear_unkeyed();
 	
 	/* object ipos are calculated in where_is_object */
-	do_all_data_ipos();
+	do_all_data_ipos(); // EVIL: REMOVE THIS!!
 	
 	if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_FRAMECHANGED);
 	

Modified: branches/animsys-aligorith/source/blender/include/BIF_keyframing.h
===================================================================
--- branches/animsys-aligorith/source/blender/include/BIF_keyframing.h	2007-12-30 23:27:35 UTC (rev 13067)
+++ branches/animsys-aligorith/source/blender/include/BIF_keyframing.h	2007-12-30 23:34:23 UTC (rev 13068)
@@ -30,8 +30,8 @@
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
  
-#ifndef BIF_EDITIPO_H
-#define BIF_EDITIPO_H
+#ifndef BIF_KEYFRAMING_H
+#define BIF_KEYFRAMING_H
 
 struct bAnimData;
 struct bKeyableType;

Modified: branches/animsys-aligorith/source/blender/makesdna/DNA_animdata_types.h
===================================================================
--- branches/animsys-aligorith/source/blender/makesdna/DNA_animdata_types.h	2007-12-30 23:27:35 UTC (rev 13067)
+++ branches/animsys-aligorith/source/blender/makesdna/DNA_animdata_types.h	2007-12-30 23:34:23 UTC (rev 13068)
@@ -107,7 +107,9 @@
 enum {
 	INSERTKEY_NEEDED 	= (1<<0),	/* only insert keyframes where they're needed */
 	INSERTKEY_MATRIX 	= (1<<1),	/* insert 'visual' keyframes where needed */
-	INSERTKEY_FAST 		= (1<<2)	/* don't recalculate handles,etc. after adding key */
+	INSERTKEY_FAST 		= (1<<2),	/* don't recalculate handles,etc. after adding key */
+	
+	INSERTKEY_DRIVER	= (1<<3)	/* insert a keyframe for a driver (only used by insert_key) */
 } eInsertKeyFlags;
 
 /* extra flgs for KeyingSets (bKeyingSet->flag2) */
@@ -151,7 +153,7 @@
 	ANIMDATA_NLA_SOLO 	= (1<<1),	/* only active action is evaluated */
 } eAnimData_Flag;
 
-/* recalc flags for bAnimData */
+/* recalc flags for bAnimData - set by depsgraph */
 enum eAnimData_Recalc {
 	ANIMDATA_RECALC_DRIVERS 	= (1<<0), 	/* relevant drivers need to be executed */
 	ANIMDATA_RECALC_ANIM		= (1<<1) 	/* relevant animdata needs to be executed */

Modified: branches/animsys-aligorith/source/blender/makesdna/DNA_nla_types.h
===================================================================
--- branches/animsys-aligorith/source/blender/makesdna/DNA_nla_types.h	2007-12-30 23:27:35 UTC (rev 13067)
+++ branches/animsys-aligorith/source/blender/makesdna/DNA_nla_types.h	2007-12-30 23:34:23 UTC (rev 13068)
@@ -113,7 +113,8 @@
 	ACTSTRIP_CYCLIC_USEX	= (1<<8),
 	ACTSTRIP_CYCLIC_USEY	= (1<<9),
 	ACTSTRIP_CYCLIC_USEZ	= (1<<10),
-	ACTSTRIP_AUTO_BLENDS	= (1<<11)
+	ACTSTRIP_AUTO_BLENDS	= (1<<11),
+	ACTSTRIP_TWEAK			= (1<<12),	/* This strip is a tweaking strip (only set if owner track is a tweak track) */
 } eActionStrip_Flag;
 
 

Modified: branches/animsys-aligorith/source/blender/src/keyframing.c
===================================================================
--- branches/animsys-aligorith/source/blender/src/keyframing.c	2007-12-30 23:27:35 UTC (rev 13067)
+++ branches/animsys-aligorith/source/blender/src/keyframing.c	2007-12-30 23:34:23 UTC (rev 13068)
@@ -30,6 +30,10 @@
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
+ 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif 
   
 #include "MEM_guardedalloc.h"
 
@@ -181,13 +185,13 @@
 }
 
 /* Validate animation holders... */
-IpoCurve *validate_animdata_data (bAnimData *adt, bKeyableType *kt)
+IpoCurve *validate_animdata_data (bAnimData *adt, bKeyableType *kt, short flag)
 {
 	/* abort if no valid data */
 	if ((adt == NULL) || (kt == NULL))
 		return NULL;
 		
-	/* 1. create new action (or use active)
+	/* 1. create new action (or use active) -> normal or for drivers
 	 * 2. create new ipo-block (or use active), and add that to the action
 	 * 3. create new ipo-curve (or use relevant one)
 	 */
@@ -537,13 +541,14 @@
  * 	Use this to create any necessary animation data, and then insert a keyframe
  *	using the current value being keyframed, in the relevant place.
  *	
- *	The flag variable is used for special settings that alter the behaviour of
+ *	The flag argument is used for special settings that alter the behaviour of
  *	the keyframe insertion. These include the 'visual' keyframing modes, quick refresh,
  *	and extra keyframe filtering.
  */
 void insert_key (bAnimData *adt, bKeyableType *kt, void *data, short flag)
 {
-	IpoCurve *icu= validate_animdata_data(adt, kt);
+	IpoCurve *icu= validate_animdata_data(adt, kt, (flag & INSERTKEY_DRIVER));
+	bActionStrip *strip= adt_get_active_strip(adt);
 	float cfra = frame_to_float(CFRA);
 	float curval= 0.0f;
 	
@@ -551,13 +556,12 @@
 	if (icu) {
 		/* apply scaling of time - special cases */
 		if (1==0 /* TODO: need macro to test if nla-scale time */) {
-			// TODO: get_action_frame needs to be updated to deal with new code 
-			//cfra= get_action_frame(adt, cfra);
+			cfra= get_action_frame(adt, cfra);
 		}
 		if (adt->blocktype == IPOB_OB) {
 			Object *ob= (Object *)data;
 			
-			/* time-offset stuff from ages ago... */
+			/* ancient time-offset cruft... we should kill this someday */
 			if ((ob->sf != 0.0) && (ob->ipoflag & OB_OFFS_OB)) {
 				/* actually frametofloat calc again! */
 				cfra-= ob->sf*G.scene->r.framelen;
@@ -585,7 +589,9 @@
 		}
 		
 		/* check if we're keying to a nla "tweak" strip */
-		// TODO...
+		if ((strip) && (strip->flag & ACTSTRIP_TWEAK)) {
+			// TODO: perform special calculations to remove effects of existing nla data
+		}		
 		
 		/* only insert keyframes where they are needed */
 		if (flag & INSERTKEY_NEEDED) {
@@ -628,7 +634,7 @@
 } bCommonKeySource;
 
 /* extract animdata + data from buttons-window */
-static void get_animdata_butsspace (bAnimData **adt, void **data, ListBase *keyingsets, short flag)
+static void get_animdata_butsspace (ListBase *animsrcs, ListBase *keyingsets, short flag)
 {
 	
 }
@@ -712,6 +718,7 @@
 {
 	DynStr *pupds= BLI_dynstr_new();
 	bKeyingSet *ks;
+	char buf[32];
 	char *str;
 	int i;
 	
@@ -724,7 +731,8 @@
 	/* loop through keyingsets, adding them */
 	for (ks=keyingsets->first, i=1; ks; ks=ks->next, i++) {
 		BLI_dynstr_append(pupds, ks->name);
-		BLI_dynstr_append(pupds, "%%x%d", i);
+		sprintf(buf, "%%x%d", i);
+		BLI_dynstr_append(pupds, buf);
 		
 		if (ks->next)
 			BLI_dynstr_append(pupds, "|");
@@ -873,11 +881,11 @@
 		for (ktl= ks->keyabletypes.first; ktl; ktl= ktl->next) {
 			short flag = 0;
 			
-			// todo: check global settings for flags to add
 			/* local flags only add on to global flags */
 			flag = ktl->flag;
 			if (G.flags & G_AUTOMATKEYS) flag |= INSERTKEY_MATRIX;
 			if (U.uiflag & USER_KEYINSERTNEED) flag |= INSERTKEY_NEEDED;
+			if (flag & COMMONIKEY_DRIVER_KEY) flag |= INSERTKEY_DRIVER;
 			
 			insert_key(cks->adt, ks->kt, cks->data, flag);
 		}





More information about the Bf-blender-cvs mailing list