[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37731] branches/soc-2011-pepper/source/ blender/editors: Bugfixes for recent commits:

Joshua Leung aligorith at gmail.com
Wed Jun 22 15:31:00 CEST 2011


Revision: 37731
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37731
Author:   aligorith
Date:     2011-06-22 13:30:59 +0000 (Wed, 22 Jun 2011)
Log Message:
-----------
Bugfixes for recent commits:
* Insert Key on Selected Channels in Action Editor was broken
* Transform/Select All tools in Action Editor were broken as result of
filtering changes.
* Set Visibility operator, when used from Graph Editor now does
similar things to the TabKey lock/unlock operator with regards to the
flags it uses for filtering

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/editors/animation/anim_channels_edit.c
    branches/soc-2011-pepper/source/blender/editors/animation/anim_filter.c
    branches/soc-2011-pepper/source/blender/editors/space_action/action_edit.c

Modified: branches/soc-2011-pepper/source/blender/editors/animation/anim_channels_edit.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/animation/anim_channels_edit.c	2011-06-22 12:54:26 UTC (rev 37730)
+++ branches/soc-2011-pepper/source/blender/editors/animation/anim_channels_edit.c	2011-06-22 13:30:59 UTC (rev 37731)
@@ -1236,9 +1236,20 @@
 	ANIM_animdata_filter(&ac, &all_data, filter, ac.data, ac.datatype);
 		
 	/* hide all channels not selected
-	 * - restrict this to only applying on settings we can get to in the list
+	 * - hierarchy matters if we're doing this from the channels region
+	 *   since we only want to apply this to channels we can "see", 
+	 *   and have these affect their relatives
+	 * - but for Graph Editor, this gets used also from main region
+	 *   where hierarchy doesn't apply, as for [#21276]
 	 */
-	filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_UNSEL | ANIMFILTER_NODUPLIS);
+	if ((ac.spacetype == SPACE_IPO) && (ac.regiontype != RGN_TYPE_CHANNELS)) {
+		/* graph editor (case 2) */
+		filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_UNSEL | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS);
+	}
+	else {
+		/* standard case */
+		filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_UNSEL | ANIMFILTER_NODUPLIS);
+	}
 	ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
 	
 	for (ale= anim_data.first; ale; ale= ale->next) {

Modified: branches/soc-2011-pepper/source/blender/editors/animation/anim_filter.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/animation/anim_filter.c	2011-06-22 12:54:26 UTC (rev 37730)
+++ branches/soc-2011-pepper/source/blender/editors/animation/anim_filter.c	2011-06-22 13:30:59 UTC (rev 37731)
@@ -984,7 +984,7 @@
 			 *	- pasting keyframes
 			 *	- creating ghost curves in Graph Editor
 			 */
-			filter_gmode &= ~(ANIMFILTER_SEL|ANIMFILTER_UNSEL);
+			filter_gmode &= ~(ANIMFILTER_SEL|ANIMFILTER_UNSEL|ANIMFILTER_LIST_VISIBLE);
 		}
 		
 		
@@ -1007,7 +1007,7 @@
 		 */
 		if (first_fcu) {
 			/* add this group as a channel first */
-			if (filter_mode & ANIMFILTER_LIST_CHANNELS) {
+			if (filter_gmode & ANIMFILTER_LIST_CHANNELS) {
 				/* 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, owner_id);
@@ -1019,7 +1019,7 @@
 			}
 			
 			/* there are some situations, where only the channels of the action group should get considered */
-			if (!(filter_mode & ANIMFILTER_ACTGROUPED) || (agrp->flag & AGRP_ACTIVE)) {
+			if (!(filter_gmode & ANIMFILTER_ACTGROUPED) || (agrp->flag & AGRP_ACTIVE)) {
 				/* filters here are a bit convoulted...
 				 *	- groups show a "summary" of keyframes beside their name which must accessable for tools which handle keyframes
 				 *	- groups can be collapsed (and those tools which are only interested in channels rely on knowing that group is closed)
@@ -1027,16 +1027,19 @@
 				 * cases when we should include F-Curves inside group:
 				 *	- we don't care about hierarchy visibility (i.e. we just need the F-Curves present)
 				 *	- group is expanded
+				 *	- we care about hierarchy visibility, but we also just need the F-Curves present 
+				 *	  within (i.e. transform/selectall). Fix relies on showing all channels option
+				 *	  only ever getting used for drawing, when hierarchy shouldn't show these channels
 				 */
-				if ( (!(filter_mode & ANIMFILTER_LIST_VISIBLE) || EXPANDED_AGRP(ac, agrp)) )
+				if (!(filter_gmode & ANIMFILTER_LIST_VISIBLE) || EXPANDED_AGRP(ac, agrp) || !(filter_gmode & ANIMFILTER_LIST_CHANNELS))
 				{
 					/* for the Graph Editor, curves may be set to not be visible in the view to lessen clutter,
 					 * but to do this, we need to check that the group doesn't have it's not-visible flag set preventing 
 					 * all its sub-curves to be shown
 					 */
-					if ( !(filter_mode & ANIMFILTER_CURVE_VISIBLE) || !(agrp->flag & AGRP_NOTVISIBLE) )
+					if ( !(filter_gmode & ANIMFILTER_CURVE_VISIBLE) || !(agrp->flag & AGRP_NOTVISIBLE) )
 					{
-						if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) {
+						if (!(filter_gmode & ANIMFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) {
 							/* NOTE: filter_gmode is used here, not standard filter_mode, since there may be some flags that shouldn't apply */
 							items += animdata_filter_fcurves(anim_data, ads, first_fcu, agrp, filter_gmode, owner_id);
 						}

Modified: branches/soc-2011-pepper/source/blender/editors/space_action/action_edit.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/space_action/action_edit.c	2011-06-22 12:54:26 UTC (rev 37730)
+++ branches/soc-2011-pepper/source/blender/editors/space_action/action_edit.c	2011-06-22 13:30:59 UTC (rev 37731)
@@ -575,7 +575,7 @@
 		AnimData *adt= ANIM_nla_mapping_get(ac, ale);
 		FCurve *fcu= (FCurve *)ale->key_data;
 		float cfra;
-
+		
 		/* adjust current frame for NLA-scaling */
 		if (adt)
 			cfra= BKE_nla_tweakedit_remap(adt, (float)CFRA, NLATIME_CONVERT_UNMAP);




More information about the Bf-blender-cvs mailing list