From 31bf8307afc0fb995afcf2233dc50c28b531778d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 24 Nov 2020 12:27:43 +0100 Subject: 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 --- source/blender/editors/space_graph/graph_select.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_graph/graph_select.c') 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) { -- cgit v1.2.3