[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17363] branches/animsys2/source/blender/ src: AnimSys2: Dopesheet Bugfix

Joshua Leung aligorith at gmail.com
Sat Nov 8 02:21:37 CET 2008


Revision: 17363
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17363
Author:   aligorith
Date:     2008-11-08 02:21:37 +0100 (Sat, 08 Nov 2008)

Log Message:
-----------
AnimSys2: Dopesheet Bugfix

* Insert Key options now work in the Dopesheet
* Fixed selection filtering code for Object channels (nothing much to really see here)

Modified Paths:
--------------
    branches/animsys2/source/blender/src/drawaction.c
    branches/animsys2/source/blender/src/editaction.c

Modified: branches/animsys2/source/blender/src/drawaction.c
===================================================================
--- branches/animsys2/source/blender/src/drawaction.c	2008-11-07 20:13:07 UTC (rev 17362)
+++ branches/animsys2/source/blender/src/drawaction.c	2008-11-08 01:21:37 UTC (rev 17363)
@@ -1152,7 +1152,7 @@
 	 *	   This is to try to optimise this for heavier data sets
 	 *	2) Keyframes which are out of view horizontally are disregarded 
 	 */
-	y = 0.0;
+	y = 0.0f;
 	for (ale= act_data.first; ale; ale= ale->next) {
 		const float yminc= y-CHANNELHEIGHT/2;
 		const float ymaxc= y+CHANNELHEIGHT/2;

Modified: branches/animsys2/source/blender/src/editaction.c
===================================================================
--- branches/animsys2/source/blender/src/editaction.c	2008-11-07 20:13:07 UTC (rev 17362)
+++ branches/animsys2/source/blender/src/editaction.c	2008-11-08 01:21:37 UTC (rev 17363)
@@ -645,13 +645,16 @@
 static void actdata_filter_dopesheet_ob (ListBase *act_data, bDopeSheet *ads, Base *base, int filter_mode)
 {
 	bActListElem *ale=NULL;
+	Scene *sce= (Scene *)ads->source;
 	Object *ob= base->object;
 	
 	/* add this object as a channel first */
 	if (!(filter_mode & ACTFILTER_ONLYICU) && !(filter_mode & ACTFILTER_IPOKEYS)) {
 		/* check if filtering by selection */
-		ale= make_new_actlistelem(base, ACTTYPE_OBJECT, NULL, ACTTYPE_NONE);
-		if (ale) BLI_addtail(act_data, ale);
+		if (!(filter_mode & ACTFILTER_SEL) || ((base->flag & SELECT) || (base == sce->basact)) {
+			ale= make_new_actlistelem(base, ACTTYPE_OBJECT, NULL, ACTTYPE_NONE);
+			if (ale) BLI_addtail(act_data, ale);
+		}
 	}
 	
 	/* if collapsed, don't go any further (unless adding keyframes only) */
@@ -674,8 +677,11 @@
 		{
 			/* loop through ipo-curve channels, adding them */
 			for (icu= ob->ipo->curve.first; icu; icu=icu->next) {
-				ale= make_new_actlistelem(icu, ACTTYPE_ICU, base, ACTTYPE_OBJECT);
-				if (ale) BLI_addtail(act_data, ale); 
+				/* only if selected (if checking for selection) */
+				if ( !(filter_mode & ACTFILTER_SEL) || (SEL_ICU(icu)) ) {
+					ale= make_new_actlistelem(icu, ACTTYPE_ICU, base, ACTTYPE_OBJECT);
+					if (ale) BLI_addtail(act_data, ale); 
+				}
 			}
 		}
 	}
@@ -761,11 +767,6 @@
 				/* outliner restrict-flag */
 				if (ob->restrictflag & OB_RESTRICT_VIEW) continue;
 			}
-			if (filter_mode & ACTFILTER_SEL) {
-				/* only if object is selected or active */
-				if (!(base->flag & SELECT) || (sce->basact != base))
-					continue;
-			}
 			if (!(ob->ipo) && !(ob->action) && !(ob->constraintChannels.first)) {
 				/* no animation data to show... */
 				continue;
@@ -1867,7 +1868,6 @@
 	void *data;
 	short datatype;
 	
-	Object *ob= OBACT;
 	short mode;
 	float cfra;
 	
@@ -1876,7 +1876,7 @@
 	if (data == NULL) return;
 	cfra = frame_to_float(CFRA);
 	
-	if (datatype == ACTCONT_ACTION) {
+	if (ELEM(datatype, ACTCONT_ACTION, ACTCONT_DOPESHEET)) {
 		ListBase act_data = {NULL, NULL};
 		bActListElem *ale;
 		int filter;
@@ -1895,13 +1895,23 @@
 		/* loop through ipo curves retrieved */
 		for (ale= act_data.first; ale; ale= ale->next) {
 			/* verify that this is indeed an ipo curve */
-			if (ale->key_data && ale->owner) {
-				bActionChannel *achan= (bActionChannel *)ale->owner;
+			if ((ale->key_data) && ((ale->owner) || (ale->id))) {
+				bActionChannel *achan= (ale->ownertype==ACTTYPE_ACHAN) ? ((bActionChannel *)ale->owner) : (NULL);
 				bConstraintChannel *conchan= (ale->type==ACTTYPE_CONCHAN) ? ale->data : NULL;
 				IpoCurve *icu= (IpoCurve *)ale->key_data;
+				ID *id= NULL;
 				
-				if (ob)
-					insertkey((ID *)ob, icu->blocktype, achan->name, ((conchan)?(conchan->name):(NULL)), icu->adrcode, 0);
+				if (datatype == ACTCONT_ACTION) {
+					if (ale->owner) 
+						id= ale->owner;
+				}
+				else if (datatype == ACTCONT_DOPESHEET) {
+					if (ale->id)
+						id= ale->id;
+				}
+				
+				if (id)
+					insertkey(id, icu->blocktype, ((achan)?(achan->name):(NULL)), ((conchan)?(conchan->name):(NULL)), icu->adrcode, 0);
 				else
 					insert_vert_icu(icu, cfra, icu->curval, 0);
 			}





More information about the Bf-blender-cvs mailing list