From 5e6c7de3e918f7ecbf4ea898f6e5b8a2373ad17e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 12 Oct 2020 16:55:46 +0200 Subject: Animation: enforce that the active keyframe is always selected Check selection state in `BKE_fcurve_active_keyframe_index()`, and only return the active keyframe index when that keyframe is actually selected. This is now also asserted in the `BKE_fcurve_active_keyframe_set()` function, which is now also used when inserting a keyframe. --- source/blender/editors/animation/keyframing.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender/editors/animation') diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index c2a772604f2..967ca13c17d 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -605,8 +605,7 @@ int insert_vert_fcurve( /* add temp beztriple to keyframes */ a = insert_bezt_fcurve(fcu, &beztr, flag); - - fcu->active_keyframe_index = a; + BKE_fcurve_active_keyframe_set(fcu, &fcu->bezt[a]); /* what if 'a' is a negative index? * for now, just exit to prevent any segfaults -- cgit v1.2.3