[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25533] trunk/blender/source/blender: Bugfix #20463: In graph editor bone channels cannot be selected with 'A' or 'B' border select

Joshua Leung aligorith at gmail.com
Wed Dec 23 12:22:30 CET 2009


Revision: 25533
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25533
Author:   aligorith
Date:     2009-12-23 12:22:30 +0100 (Wed, 23 Dec 2009)

Log Message:
-----------
Bugfix #20463: In graph editor bone channels cannot be selected with 'A' or 'B' border select

This bug was caused by my recent commit to get bone select -> selection syncing working. The selection flushing was occurring too readily, blocking any selection tools from having any visible effect. Now this syncing is only triggered when appropriate notifiers+flags have been set.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_action/space_action.c
    trunk/blender/source/blender/editors/space_graph/space_graph.c
    trunk/blender/source/blender/makesdna/DNA_action_types.h
    trunk/blender/source/blender/makesdna/DNA_anim_types.h
    trunk/blender/source/blender/makesdna/DNA_space_types.h

Modified: trunk/blender/source/blender/editors/space_action/space_action.c
===================================================================
--- trunk/blender/source/blender/editors/space_action/space_action.c	2009-12-23 09:55:34 UTC (rev 25532)
+++ trunk/blender/source/blender/editors/space_action/space_action.c	2009-12-23 11:22:30 UTC (rev 25533)
@@ -45,6 +45,7 @@
 #include "BKE_colortools.h"
 #include "BKE_context.h"
 #include "BKE_screen.h"
+#include "BKE_utildefines.h"
 
 #include "ED_space_api.h"
 #include "ED_screen.h"
@@ -353,15 +354,22 @@
 /* editor level listener */
 static void action_listener(ScrArea *sa, wmNotifier *wmn)
 {
+	SpaceAction *saction= (SpaceAction *)sa->spacedata.first;
+	
 	/* context changes */
 	switch (wmn->category) {
 		case NC_ANIMATION:
-			ED_area_tag_redraw(sa);
+			/* for selection changes of animation data, we can just redraw... otherwise autocolor might need to be done again */
+			if (ELEM(wmn->data, ND_KEYFRAME_SELECT, ND_ANIMCHAN_SELECT))
+				ED_area_tag_redraw(sa);
+			else
+				ED_area_tag_refresh(sa);
 			break;
 		case NC_SCENE:
 			switch (wmn->data) {	
-				case ND_OB_ACTIVE:	/* selection changed, so force refresh to flush */
+				case ND_OB_ACTIVE:	/* selection changed, so force refresh to flush (needs flag set to do syncing) */
 				case ND_OB_SELECT:
+					saction->flag |= SACTION_TEMP_NEEDCHANSYNC;
 					ED_area_tag_refresh(sa);
 					break;
 					
@@ -372,8 +380,9 @@
 			break;
 		case NC_OBJECT:
 			switch (wmn->data) {
-				case ND_BONE_SELECT:	/* selection changed, so force refresh to flush */
+				case ND_BONE_SELECT:	/* selection changed, so force refresh to flush (needs flag set to do syncing) */
 				case ND_BONE_ACTIVE:
+					saction->flag |= SACTION_TEMP_NEEDCHANSYNC;
 					ED_area_tag_refresh(sa);
 					break;
 					
@@ -391,11 +400,15 @@
 
 static void action_refresh(const bContext *C, ScrArea *sa)
 {
-	//SpaceAction *saction= CTX_wm_space_action(C);
+	SpaceAction *saction= CTX_wm_space_action(C);
 	
-	/* update the state of the animchannels in response to changes from the data they represent */
-	// TODO: check if we don't want this to happen
-	ANIM_sync_animchannels_to_data(C);
+	/* update the state of the animchannels in response to changes from the data they represent 
+	 * NOTE: the temp flag is used to indicate when this needs to be done, and will be cleared once handled
+	 */
+	if (saction->flag & SACTION_TEMP_NEEDCHANSYNC) {
+		ANIM_sync_animchannels_to_data(C);
+		saction->flag &= ~SACTION_TEMP_NEEDCHANSYNC;
+	}
 	
 	/* region updates? */
 	// XXX resizing y-extents of tot should go here?

Modified: trunk/blender/source/blender/editors/space_graph/space_graph.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/space_graph.c	2009-12-23 09:55:34 UTC (rev 25532)
+++ trunk/blender/source/blender/editors/space_graph/space_graph.c	2009-12-23 11:22:30 UTC (rev 25533)
@@ -431,18 +431,22 @@
 /* editor level listener */
 static void graph_listener(ScrArea *sa, wmNotifier *wmn)
 {
+	SpaceIpo *sipo= (SpaceIpo *)sa->spacedata.first;
+	
 	/* context changes */
 	switch (wmn->category) {
 		case NC_ANIMATION:
-			/* unlike for DopeSheet, we want refresh not redraw here, 
-			 * since F-Curve colors may need setting 
-			 */
-			ED_area_tag_refresh(sa);
+			/* for selection changes of animation data, we can just redraw... otherwise autocolor might need to be done again */
+			if (ELEM(wmn->data, ND_KEYFRAME_SELECT, ND_ANIMCHAN_SELECT))
+				ED_area_tag_redraw(sa);
+			else
+				ED_area_tag_refresh(sa);
 			break;
 		case NC_SCENE:
 			switch (wmn->data) {	
-				case ND_OB_ACTIVE:	/* selection changed, so force refresh to flush */
+				case ND_OB_ACTIVE:	/* selection changed, so force refresh to flush (needs flag set to do syncing)  */
 				case ND_OB_SELECT:
+					sipo->flag |= SIPO_TEMP_NEEDCHANSYNC;
 					ED_area_tag_refresh(sa);
 					break;
 					
@@ -453,8 +457,9 @@
 			break;
 		case NC_OBJECT:
 			switch (wmn->data) {
-				case ND_BONE_SELECT:	/* selection changed, so force refresh to flush */
+				case ND_BONE_SELECT:	/* selection changed, so force refresh to flush (needs flag set to do syncing) */
 				case ND_BONE_ACTIVE:
+					sipo->flag |= SIPO_TEMP_NEEDCHANSYNC;
 					ED_area_tag_refresh(sa);
 					break;
 					
@@ -467,9 +472,11 @@
 			if(wmn->data == ND_SPACE_GRAPH)
 				ED_area_tag_redraw(sa);
 			break;
-		default:
-			if(wmn->data==ND_KEYS)
-				ED_area_tag_refresh(sa);
+		
+		// XXX: restore the case below if not enough updates occur...
+		//default:
+		//	if(wmn->data==ND_KEYS)
+		//		ED_area_tag_redraw(sa);
 	}
 }
 
@@ -498,9 +505,13 @@
 	/* region updates? */
 	// XXX resizing y-extents of tot should go here?
 	
-	/* update the state of the animchannels in response to changes from the data they represent */
-	// TODO: check if we don't want this to happen
-	ANIM_sync_animchannels_to_data(C);
+	/* update the state of the animchannels in response to changes from the data they represent 
+	 * NOTE: the temp flag is used to indicate when this needs to be done, and will be cleared once handled
+	 */
+	if (sipo->flag & SIPO_TEMP_NEEDCHANSYNC) {
+		ANIM_sync_animchannels_to_data(C);
+		sipo->flag &= ~SIPO_TEMP_NEEDCHANSYNC;
+	}
 	
 	/* init/adjust F-Curve colors */
 	if (ANIM_animdata_get_context(C, &ac)) {

Modified: trunk/blender/source/blender/makesdna/DNA_action_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_action_types.h	2009-12-23 09:55:34 UTC (rev 25532)
+++ trunk/blender/source/blender/makesdna/DNA_action_types.h	2009-12-23 11:22:30 UTC (rev 25533)
@@ -503,6 +503,8 @@
 	SACTION_NODRAWGCOLORS = (1<<7),
 		/* don't draw current frame number beside frame indicator */
 	SACTION_NODRAWCFRANUM = (1<<8),
+		/* temporary flag to force channel selections to be synced with main */
+	SACTION_TEMP_NEEDCHANSYNC = (1<<9),
 } eSAction_Flag;	
 
 /* SpaceAction Mode Settings */

Modified: trunk/blender/source/blender/makesdna/DNA_anim_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_anim_types.h	2009-12-23 09:55:34 UTC (rev 25532)
+++ trunk/blender/source/blender/makesdna/DNA_anim_types.h	2009-12-23 11:22:30 UTC (rev 25533)
@@ -659,6 +659,7 @@
 	KSP_TEMPLATE_PCHAN 			= (1<<1),	/* #pch - selected posechannel */
 	KSP_TEMPLATE_CONSTRAINT 	= (1<<2),	/* #con - active only */
 	KSP_TEMPLATE_NODE		 	= (1<<3),	/* #nod - selected node */
+	KSP_TEMPLATE_MODIFIER		= (1<<4),	/* #mod - active only */
 	
 	KSP_TEMPLATE_ROT		= (1<<16),	/* modify rotation paths based on rotation mode of Object or Pose Channel */
 } eKSP_TemplateTypes;

Modified: trunk/blender/source/blender/makesdna/DNA_space_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_space_types.h	2009-12-23 09:55:34 UTC (rev 25532)
+++ trunk/blender/source/blender/makesdna/DNA_space_types.h	2009-12-23 11:22:30 UTC (rev 25533)
@@ -720,16 +720,29 @@
 #define SI_COLOR_CORRECTION	1<<24
 
 /* SpaceIpo->flag (Graph Editor Settings) */
+	/* OLD DEPRECEATED SETTING */
 #define SIPO_LOCK_VIEW			(1<<0)
+	/* don't merge keyframes on the same frame after a transform */
 #define SIPO_NOTRANSKEYCULL		(1<<1)
+	/* don't show any keyframe handles at all */
 #define SIPO_NOHANDLES			(1<<2)
+	/* don't show current frame number beside indicator line */
 #define SIPO_NODRAWCFRANUM		(1<<3)
+	/* show timing in seconds instead of frames */
 #define SIPO_DRAWTIME			(1<<4)
+	/* only show keyframes for selected F-Curves */
 #define SIPO_SELCUVERTSONLY		(1<<5)
+	/* draw names of F-Curves beside the respective curves */
+	/* NOTE: currently not used */
 #define SIPO_DRAWNAMES			(1<<6)
+	/* show sliders in channels list */
 #define SIPO_SLIDERS			(1<<7)
+	/* don't show the horizontal component of the cursor */
 #define SIPO_NODRAWCURSOR		(1<<8)
+	/* only show handles of selected keyframes */
 #define SIPO_SELVHANDLESONLY	(1<<9)
+	/* temporary flag to force channel selections to be synced with main */
+#define SIPO_TEMP_NEEDCHANSYNC	(1<<10)
 
 /* SpaceIpo->mode (Graph Editor Mode) */
 enum {





More information about the Bf-blender-cvs mailing list