[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26735] trunk/blender/source/blender/ editors: More bugfixes for setting visibility of anim channels using VKEY:

Joshua Leung aligorith at gmail.com
Tue Feb 9 12:59:02 CET 2010


Revision: 26735
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26735
Author:   aligorith
Date:     2010-02-09 12:59:02 +0100 (Tue, 09 Feb 2010)

Log Message:
-----------
More bugfixes for setting visibility of anim channels using VKEY:
* Fixed problem where selecting an individual F-Curve would not set the selection correctly. 
Group channels still needed a separate selection check before they get included in the filtered list. I had removed this in an earlier fixing commit today, but overlooked that expanded groups wouldn't get this check. Therefore, group channels would also be flushed on, turning all channels of group on.

* Removed the 'curvesonly' test from deciding whether the selection status + collapsed group fix, from the earlier commit, since this was making a few cases get overlooked (namely for setting visibility toggles, where selected F-Curves in closed and deselected groups still managed to get through)

* Added a debugging print API call for helping with debugging this sort of error in future. It just prints the types of channels being operated on, to easily see what's going on...

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/anim_channels_defines.c
    trunk/blender/source/blender/editors/animation/anim_filter.c
    trunk/blender/source/blender/editors/include/ED_anim_api.h

Modified: trunk/blender/source/blender/editors/animation/anim_channels_defines.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_channels_defines.c	2010-02-09 11:18:17 UTC (rev 26734)
+++ trunk/blender/source/blender/editors/animation/anim_channels_defines.c	2010-02-09 11:59:02 UTC (rev 26735)
@@ -2302,6 +2302,36 @@
 
 /* --------------------------- */
 
+/* Print debug info string for the given channel */
+void ANIM_channel_debug_print_info (bAnimListElem *ale, short indent_level)
+{
+	bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+	
+	/* print indents */
+	for (; indent_level > 0; indent_level--)
+		printf("  ");
+	
+	/* print info */
+	if (acf) {
+		char name[256]; /* hopefully this will be enough! */
+		
+		/* get UI name */
+		if (acf->name)
+			acf->name(ale, name);
+		else
+			sprintf(name, "<No name>");
+			
+		/* print type name + ui name */
+		printf("ChanType: <%s> Name: \"%s\"\n", acf->channel_type_name, name);
+	}
+	else if (ale)
+		printf("ChanType: <Unknown - %d>\n", ale->type);
+	else
+		printf("<Invalid channel - NULL>\n");
+}
+
+/* --------------------------- */
+
 /* Check if some setting for a channel is enabled 
  * Returns: 1 = On, 0 = Off, -1 = Invalid
  */

Modified: trunk/blender/source/blender/editors/animation/anim_filter.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_filter.c	2010-02-09 11:18:17 UTC (rev 26734)
+++ trunk/blender/source/blender/editors/animation/anim_filter.c	2010-02-09 11:59:02 UTC (rev 26735)
@@ -940,11 +940,10 @@
 		/* make a copy of filtering flags for use by the sub-channels of this group */
 		filter_gmode= filter_mode;
 		
-		/* if we care about the selection status of the channels and the group's contents, 
+		/* if we care about the selection status of the channels, 
 		 * but the group isn't expanded...
 		 */
 		if ( (filter_mode & (ANIMFILTER_SEL|ANIMFILTER_UNSEL)) &&	/* care about selection status */
-			 (filter_mode & ANIMFILTER_CURVESONLY) &&				/* care about contents of group only */
 			 (EXPANDED_AGRP(agrp)==0) )								/* group isn't expanded */
 		{
 			/* if the group itself isn't selected appropriately, we shouldn't consider it's children either */
@@ -973,10 +972,13 @@
 		if (first_fcu) {
 			/* add this group as a channel first */
 			if ((filter_mode & ANIMFILTER_CHANNELS) || !(filter_mode & ANIMFILTER_CURVESONLY)) {
+				/* filter selection of channel specially here again, since may be open and not subject to previous test */
+				if ( ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) ) {
 				ale= make_new_animlistelem(agrp, ANIMTYPE_GROUP, NULL, ANIMTYPE_NONE, owner_id);
-				if (ale) {
-					BLI_addtail(anim_data, ale);
-					items++;
+					if (ale) {
+						BLI_addtail(anim_data, ale);
+						items++;
+					}
 				}
 			}
 			

Modified: trunk/blender/source/blender/editors/include/ED_anim_api.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_anim_api.h	2010-02-09 11:18:17 UTC (rev 26734)
+++ trunk/blender/source/blender/editors/include/ED_anim_api.h	2010-02-09 11:59:02 UTC (rev 26735)
@@ -365,6 +365,9 @@
 /* Get typeinfo for the given channel */
 bAnimChannelType *ANIM_channel_get_typeinfo(bAnimListElem *ale);
 
+/* Print debugging info about a given channel */
+void ANIM_channel_debug_print_info(bAnimListElem *ale, short indent_level);
+
 /* Draw the given channel */
 void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc);
 /* Draw the widgets for the given channel */





More information about the Bf-blender-cvs mailing list