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-10-12 17:55:46 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-10-12 18:00:11 +0300
commit5e6c7de3e918f7ecbf4ea898f6e5b8a2373ad17e (patch)
tree0011f9a4c38186e1fea9b325e843a9b23d8645e6 /source/blender/editors/animation/keyframing.c
parent0d3e192660bfa231aacf80d3e5a3d750155798ea (diff)
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.
Diffstat (limited to 'source/blender/editors/animation/keyframing.c')
-rw-r--r--source/blender/editors/animation/keyframing.c3
1 files changed, 1 insertions, 2 deletions
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