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:
authorSybren A. Stüvel <sybren@blender.org>2020-11-24 14:27:43 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-11-24 14:27:43 +0300
commit31bf8307afc0fb995afcf2233dc50c28b531778d (patch)
tree7c25daa0798ebfb1e1d26ccbbe5f4129a549edd1 /source/blender/editors/space_graph/graph_select.c
parentbb5c4de00973ee9723c769174930b181cbc256c0 (diff)
Graph Editor: fix keyframe not activating in certain cases
When clicking on an already-selected keyframe, mark it as active if the click caused the previously-active keyframe to become deselected. When clicking on a key in the graph editor, it is selected and all other keys are deselected. If that key was already selected before the click, it would not become the active keyframe. This is now fixed. Reviewed by: Severin Differential Revision: https://developer.blender.org/D9639
Diffstat (limited to 'source/blender/editors/space_graph/graph_select.c')
-rw-r--r--source/blender/editors/space_graph/graph_select.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index ba684972dd7..13f2219d7af 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -1518,8 +1518,13 @@ static int mouse_graph_keys(bAnimContext *ac,
something_was_selected = true;
}
- if (!run_modal && BEZT_ISSEL_ANY(bezt) && !already_selected) {
- BKE_fcurve_active_keyframe_set(nvi->fcu, bezt);
+ if (!run_modal && BEZT_ISSEL_ANY(bezt)) {
+ const bool may_activate = !already_selected ||
+ BKE_fcurve_active_keyframe_index(nvi->fcu) ==
+ FCURVE_ACTIVE_KEYFRAME_NONE;
+ if (may_activate) {
+ BKE_fcurve_active_keyframe_set(nvi->fcu, bezt);
+ }
}
}
else if (nvi->fpt) {