[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59756] trunk/blender/source/blender/ editors/space_graph/graph_select.c: Graph Editor: Preserve active curve when using AKEY to toggle selection status

Joshua Leung aligorith at gmail.com
Tue Sep 3 01:32:22 CEST 2013


Revision: 59756
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59756
Author:   aligorith
Date:     2013-09-02 23:32:21 +0000 (Mon, 02 Sep 2013)
Log Message:
-----------
Graph Editor: Preserve active curve when using AKEY to toggle selection status
of keyframe verts

Previously, every time you toggled the selection of all keyframes (using AKEY),
the active curve would get deselected and deactivated. However, this was a pain
when trying to tweak the shape of a particular curve, as doing this would cause
that curve to either fade into the background or into the jumble of other
curves.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_graph/graph_select.c

Modified: trunk/blender/source/blender/editors/space_graph/graph_select.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/graph_select.c	2013-09-02 22:57:22 UTC (rev 59755)
+++ trunk/blender/source/blender/editors/space_graph/graph_select.c	2013-09-02 23:32:21 UTC (rev 59756)
@@ -149,17 +149,37 @@
 static int graphkeys_deselectall_exec(bContext *C, wmOperator *op)
 {
 	bAnimContext ac;
+	bAnimListElem *ale_active = NULL;
 	
 	/* get editor data */
 	if (ANIM_animdata_get_context(C, &ac) == 0)
 		return OPERATOR_CANCELLED;
-		
+	
+	/* find active F-Curve, and preserve this for later 
+	 * or else it becomes annoying with the current active
+	 * curve keeps fading out even while you're editing it
+	 */
+	ale_active = get_active_fcurve_channel(&ac);
+	
 	/* 'standard' behavior - check if selected, then apply relevant selection */
 	if (RNA_boolean_get(op->ptr, "invert"))
 		deselect_graph_keys(&ac, 0, SELECT_INVERT, TRUE);
 	else
 		deselect_graph_keys(&ac, 1, SELECT_ADD, TRUE);
 	
+	/* restore active F-Curve... */
+	if (ale_active) {
+		FCurve *fcu = (FCurve *)ale_active->data;
+		
+		/* all others should not be disabled, so we should be able to just set this directly... 
+		 * - selection needs to be set too, or else this won't work...
+		 */
+		fcu->flag |= (FCURVE_SELECTED | FCURVE_ACTIVE);
+		
+		MEM_freeN(ale_active);
+		ale_active = NULL;
+	}
+	
 	/* set notifier that things have changed */
 	WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_SELECTED, NULL);
 	




More information about the Bf-blender-cvs mailing list