Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2013-09-03 03:32:21 +0400
committerJoshua Leung <aligorith@gmail.com>2013-09-03 03:32:21 +0400
commit67a3b8be9086a187bc008f2536f11018195b42fa (patch)
tree3a006bf803eef0dad85f17404c471992ad2712c9 /source/blender/editors/space_graph
parent0a24e05cb31ba49816f4712ae7b642d7e1b6a49e (diff)
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.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_select.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index aaaafa93bb0..d87bd9a5077 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -149,17 +149,37 @@ static void deselect_graph_keys(bAnimContext *ac, short test, short sel, short d
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);