diff options
author | Joshua Leung <aligorith@gmail.com> | 2016-05-09 07:58:12 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2016-05-09 08:23:35 +0300 |
commit | 0578d3ef3e53faa447880bb939aa33272464cef1 (patch) | |
tree | 16e3bfb5600d7c47b4823b3fe5ffee5c35fb0c67 /source/blender/editors/space_graph/graph_edit.c | |
parent | 9a1e11260c667dce5df123c2b451d119d8c05a7b (diff) |
Graph Editor: Ctrl-Click keyframing now deselects all existing keyframes by default
Now, when creating new keyframes in the graph editor by ctrl-clicking, only
the newly created keyframes will be selected. This is a little workflow tweak
to make it faster to work, as you no longer have to deselect all, and then
re-select the newly added keys in order to manipulate them.
The old behaviour (not modifying the selection status of the old keys) has been
kept, but is now available via Shift-Ctrl-Click.
Feature request from @Shhlife
Diffstat (limited to 'source/blender/editors/space_graph/graph_edit.c')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index effcd80e1f0..f1063996ca3 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -693,6 +693,14 @@ static int graphkeys_click_insert_exec(bContext *C, wmOperator *op) short mapping_flag = ANIM_get_normalization_flags(&ac); float scale, offset; + /* preserve selection? */ + if (RNA_boolean_get(op->ptr, "extend") == false) { + /* deselect all keyframes first, so that we can immediately start manipulating the newly added one(s) + * - only affect the keyframes themselves, as we don't want channels popping in and out... + */ + deselect_graph_keys(&ac, false, SELECT_SUBTRACT, false); + } + /* get frame and value from props */ frame = RNA_float_get(op->ptr, "frame"); val = RNA_float_get(op->ptr, "value"); @@ -782,6 +790,8 @@ void GRAPH_OT_click_insert(wmOperatorType *ot) /* properties */ RNA_def_float(ot->srna, "frame", 1.0f, -FLT_MAX, FLT_MAX, "Frame Number", "Frame to insert keyframe on", 0, 100); RNA_def_float(ot->srna, "value", 1.0f, -FLT_MAX, FLT_MAX, "Value", "Value for keyframe on", 0, 100); + + RNA_def_boolean(ot->srna, "extend", false, "Extend", "Extend selection instead of deselecting everything first"); } /* ******************** Copy/Paste Keyframes Operator ************************* */ |