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

Joshua Leung aligorith at gmail.com
Sun Dec 16 12:08:20 CET 2007


Revision: 12909
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12909
Author:   aligorith
Date:     2007-12-16 12:08:20 +0100 (Sun, 16 Dec 2007)

Log Message:
-----------
== AnimSys Branch ==

* More work on getting keyframing (with keyingsets) working. Keyframes can now be added to all selected objects/bones/data (where appropriate) again.

* KeyingSets now store the blocktype their keyable-types belong to. KeyingSets can only have keyable-types from compatible types anyway...

* Action scaling functions now check in AnimData instead of Object, as NLA-stuff is now located there.

* Added a new case for NLA-strip-evaluation (blend between strips in a track if first strip doesn't have hold on)

Modified Paths:
--------------
    branches/animsys-aligorith/source/blender/blenkernel/BKE_action.h
    branches/animsys-aligorith/source/blender/blenkernel/BKE_ipo.h
    branches/animsys-aligorith/source/blender/blenkernel/BKE_nla.h
    branches/animsys-aligorith/source/blender/blenkernel/intern/action.c
    branches/animsys-aligorith/source/blender/blenkernel/intern/keyingsets.c
    branches/animsys-aligorith/source/blender/blenkernel/intern/nla.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/src/keyframing.c

Modified: branches/animsys-aligorith/source/blender/blenkernel/BKE_action.h
===================================================================
--- branches/animsys-aligorith/source/blender/blenkernel/BKE_action.h	2007-12-16 06:50:49 UTC (rev 12908)
+++ branches/animsys-aligorith/source/blender/blenkernel/BKE_action.h	2007-12-16 11:08:20 UTC (rev 12909)
@@ -75,14 +75,7 @@
 
 void make_local_action(struct bAction *act);
 
-/* only for armatures, doing pose actions only too */
-void do_all_pose_actions(struct Object *);
-/* only for objects, doing only 1 channel */
-void do_all_object_actions(struct Object *);
-/* only for Mesh, Curve, Surface, Lattice, doing only Shape channel */
-void do_all_shape_actions(struct Object *);
 
-
 /**
  * Return a pointer to the pose channel of the given name
  * from this pose.
@@ -121,7 +114,7 @@
 void extract_pose_from_action(struct bPose *pose, struct bAction *act, float ctime);
 
 /**
- * Get the effects of the given action using a workob 
+ * Get the effects of the given action using a workob (for action constraint)
  */
 void what_does_obaction(struct Object *ob, struct bAction *act, float cframe);
 
@@ -138,9 +131,6 @@
  */
 struct bActionChannel *verify_action_channel(struct bAction *act, const char *name);
 
-  /* baking */
-struct bAction *bake_obIPO_to_action(struct Object *ob);
-
 /* exported for game engine */
 void blend_poses(struct bPose *dst, struct bPose *src, float srcweight, short mode);
 void extract_pose_from_pose(struct bPose *pose, const struct bPose *src);
@@ -151,9 +141,9 @@
 void rest_pose(struct bPose *pose);
 
 /* map global time (frame nr) to strip converted time, doesn't clip */
-float get_action_frame(struct Object *ob, float cframe);
+float get_action_frame(struct bAnimData *adt, float cframe);
 /* map strip time to global time (frame nr)  */
-float get_action_frame_inv(struct Object *ob, float cframe);
+float get_action_frame_inv(struct bAnimData *adt, float cframe);
 
 #ifdef __cplusplus
 };

Modified: branches/animsys-aligorith/source/blender/blenkernel/BKE_ipo.h
===================================================================
--- branches/animsys-aligorith/source/blender/blenkernel/BKE_ipo.h	2007-12-16 06:50:49 UTC (rev 12908)
+++ branches/animsys-aligorith/source/blender/blenkernel/BKE_ipo.h	2007-12-16 11:08:20 UTC (rev 12909)
@@ -138,6 +138,7 @@
 void keyingset_default_getdata(struct bKeyingSet *ks, int blocktype);
 void keyingset_default_freedata(struct bKeyingSet *ks);
 
+void keyingsets_blocktype_default(struct ListBase *list, int blocktype);
 void init_keyingsets(void);
 
 /* ------------- IPO - Calculations ------------------ */

Modified: branches/animsys-aligorith/source/blender/blenkernel/BKE_nla.h
===================================================================
--- branches/animsys-aligorith/source/blender/blenkernel/BKE_nla.h	2007-12-16 06:50:49 UTC (rev 12908)
+++ branches/animsys-aligorith/source/blender/blenkernel/BKE_nla.h	2007-12-16 11:08:20 UTC (rev 12909)
@@ -25,7 +25,7 @@
  *
  * The Original Code is: all of this file.
  *
- * Contributor(s): none yet.
+ * Contributor(s): 2007, Joshua Leung (Animation System Recode)
  *
  * ***** END GPL/BL DUAL LICENSE BLOCK *****
  */
@@ -33,14 +33,20 @@
 #ifndef BKE_NLA_H
 #define BKE_NLA_H
 
+struct bAnimData;
+struct bNlaTrack;
 struct bActionStrip;
-struct ListBase;
-struct Object;
 
-void free_actionstrip (struct bActionStrip* strip);
-void free_nlastrips (struct ListBase *nlalist);
-void copy_nlastrips (struct ListBase *dst, struct ListBase *src);
-void copy_actionstrip (struct bActionStrip **dst, struct bActionStrip **src);
+void free_nlastrip (struct bActionStrip *strip)
+void free_nlatrack(struct bNlaTrack *nlt)
+void free_animdata(struct bAnimData *adt);
+struct bAnimData *add_animdata(char name[], int blocktype);
+
+void do_nla(struct bAnimData *adt, void *data, float ctime);
+void do_animdata(struct bAnimData *adt, void *data, float ctime);
+
+
+
 void find_stridechannel(struct Object *ob, struct bActionStrip *strip);
 struct bActionStrip *convert_action_to_strip (struct Object *ob);
 #endif

Modified: branches/animsys-aligorith/source/blender/blenkernel/intern/action.c
===================================================================
--- branches/animsys-aligorith/source/blender/blenkernel/intern/action.c	2007-12-16 06:50:49 UTC (rev 12908)
+++ branches/animsys-aligorith/source/blender/blenkernel/intern/action.c	2007-12-16 11:08:20 UTC (rev 12909)
@@ -415,18 +415,22 @@
 
 /* ************** time ****************** */
 
-static bActionStrip *get_active_strip(Object *ob)
+static bActionStrip *get_active_strip (bAnimData *adt)
 {
-	bActionStrip *strip;
+	bNlaTrack *nlt;
+	bActionStrip *strip= NULL;
 	
-	if(ob->action==NULL)
+	if (adt->act==NULL)
 		return NULL;
 	
-	for (strip=ob->nlastrips.first; strip; strip=strip->next)
-		if(strip->flag & ACTSTRIP_ACTIVE)
-			break;
+	for (nlt=adt->nlatracks.first; nlt; nlt=nlt->next) {
+		for (strip=nlt->strips.first; strip; strip=strip->next) {
+			if (strip->flag & ACTSTRIP_ACTIVE)
+				break;
+		}
+	}
 	
-	if(strip && strip->act==ob->action)
+	if (strip && strip->act == adt->act)
 		return strip;
 	return NULL;
 }
@@ -451,21 +455,21 @@
 }
 
 /* if the conditions match, it converts current time to strip time */
-float get_action_frame(Object *ob, float cframe)
+float get_action_frame(bAnimData *adt, float cframe)
 {
-	bActionStrip *strip= get_active_strip(ob);
+	bActionStrip *strip= get_active_strip(adt);
 	
-	if(strip)
+	if (strip)
 		return get_actionstrip_frame(strip, cframe, 0);
 	return cframe;
 }
 
 /* inverted, strip time to current time */
-float get_action_frame_inv(Object *ob, float cframe)
+float get_action_frame_inv(bAnimData *adt, float cframe)
 {
-	bActionStrip *strip= get_active_strip(ob);
+	bActionStrip *strip= get_active_strip(adt);
 	
-	if(strip)
+	if (strip)
 		return get_actionstrip_frame(strip, cframe, 1);
 	return cframe;
 }

Modified: branches/animsys-aligorith/source/blender/blenkernel/intern/keyingsets.c
===================================================================
--- branches/animsys-aligorith/source/blender/blenkernel/intern/keyingsets.c	2007-12-16 06:50:49 UTC (rev 12908)
+++ branches/animsys-aligorith/source/blender/blenkernel/intern/keyingsets.c	2007-12-16 11:08:20 UTC (rev 12909)
@@ -70,7 +70,7 @@
 /* --- Helper Macros --- */ 
 
 /* quick macro for declaring templates of default keyabletypes  */
-#define KS_TEMPLATE(name, flag) {NULL, NULL, {NULL, NULL}, "name", flag, KS_DEFAULT_SET}
+#define KS_TEMPLATE(name, flag) {NULL, NULL, {NULL, NULL}, "name", 0, flag, KS_DEFAULT_SET}
  
 
 /* --- Blocktype: IPOB_OB --- */
@@ -254,12 +254,13 @@
 }
 
 /* make a new KeyingSet */
-bKeyingSet *make_new_keyingset (char name[])
+bKeyingSet *make_new_keyingset (char name[], int blocktype)
 {
 	bKeyingSet *ks;
 	
 	ks= MEM_callocN(sizeof(bKeyingSet), "bKeyingSet");
 	BLI_strncpy(ks->name, name, 32);
+	ks->blocktype= blocktype;
 	
 	return ks;
 }
@@ -350,16 +351,16 @@
 }
 
 /* get the bKeyingTypeLinks for the given KeyingSet */
-void keyingset_default_getdata (bKeyingSet *ks, int blocktype)
+void keyingset_default_getdata (bKeyingSet *ks)
 {
 	void (*get_ktl)(bKeyingSet *ks);
 	
 	/* abort if invalid arguments */
-	if ((ks == NULL) || (VALID_IPOBLOCKTYPE(blocktype)==0))
+	if (ks == NULL)
 		return;
 		
 	/* get function which will set all the keyingsets for a blocktype */
-	switch (blocktype) {
+	switch (ks->blocktype) {
 		case IPOB_OB:
 			get_ktl= get_default_ktl_ob;
 			break;
@@ -392,6 +393,29 @@
 	}	
 }
 
+/* gets all the default keyingsets for a blocktype */
+void keyingsets_blocktype_default (ListBase *list, int blocktype)
+{
+	bDefaultKS_Ref *dks;
+	
+	/* validate blocktype */
+	if (VALID_IPOBLOCKTYPE(blocktype) == 0)
+		return;
+	
+	/* get link to keyingsets */
+	dks= default_keyingsets[blocktype-1];
+	
+	/* only add if not already linked */
+	if (dks->ks->flag2 & KS_LINKED) {
+		list->first= dks->ks;
+		list->last= (bKeyingSet *)(dks->ks + dks->tot);
+		
+		/* set 'linked' flags on either end */
+		(bKeyingSet *)(list->first)->flag2 |= KS_LINKED_S;
+		(bKeyingSet *)(list->last)->flag2 |= KS_LINKED_E;
+	}
+}
+
 /* -------------------------- */
 
 /* initialise keyingsets for a blocktype */
@@ -408,13 +432,15 @@
 	
 	/* init keyingsets for blocktype */
 	for (i=0; i < dks->total; i++) {
-		/* link to previous */
+		/* link to previous, and set blocktype */
 		if (i > 0) {
 			bKeyingSet *prev= (dks->ks + i - 1);
 			bKeyingSet *cur = (dks->ks + i);
 			
 			cur->prev= prev;
 			prev->next= cur;
+			
+			cur->blocktype= blocktype;
 		}
 	}
 }

Modified: branches/animsys-aligorith/source/blender/blenkernel/intern/nla.c
===================================================================
--- branches/animsys-aligorith/source/blender/blenkernel/intern/nla.c	2007-12-16 06:50:49 UTC (rev 12908)
+++ branches/animsys-aligorith/source/blender/blenkernel/intern/nla.c	2007-12-16 11:08:20 UTC (rev 12909)
@@ -93,7 +93,7 @@
 	}
 }
 
-/* free the given animdata block and all its subdata */
+/* free the given animdata block's subdata but not the block itself */
 void free_animdata (bAnimData *adt)
 {
 	if (adt) {
@@ -129,6 +129,10 @@
 	return adt;
 }
 
+// copy_animdata
+// copy_nlatracks
+// copy_nlastrips
+
 /* ************************** Tools ************************************* */
 
 /* ************************** NLA-Evaluation **************************** */
@@ -139,6 +143,7 @@
 	
 	bNlaTrack *track;			/* track that this strip belongs to */
 	bActionStrip *strip;		/* strip that's being used */
+	bActionStrip *sblend;		/* strip that's being blended towards (if applicable) */
 	
 	short track_index;			/* the index of the track within the list */
 	short strip_mode;			/* which end of the strip are we looking at */
@@ -149,6 +154,7 @@
 	NES_TIME_BEFORE = -1,
 	NES_TIME_WITHIN,
 	NES_TIME_AFTER,
+	NES_TIME_AFTER_BLEND,
 } eNlaEvalStrip_StripMode;
 
 /* ---------------------- */
@@ -164,7 +170,7 @@
 /* gets the strip active at the current time for a track */
 static void nlatrack_ctime_get_strip (ListBase *list, bNlaTrack *nlt, short index, float ctime)
 {
-	bActionStrip *strip, *astrip=NULL;
+	bActionStrip *strip, *astrip=NULL, *bstrip=NULL;
 	bNlaEvalStrip *nes;
 	short side= 0;
 	
@@ -180,6 +186,7 @@
 		 *	- current time occurs within strip's extents
 		 *	- current time occurs before strip (if it is the first)
 		 *	- current time occurs after strip (if hold is on)
+		 *	- current time occurs between strips (1st of those isn't holding) - blend!
 		 */

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list