From 598af4545912528d8b7466f976fcb054b5f6019e Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Thu, 10 Aug 2023 11:03:01 +0200 Subject: [PATCH] Fix #110789: Apply NLA mapping when jumping to keys in the Graph Editor The new keyframe jumping code for the graph editor did not respect the NLA strip offset. This patch fixes that by applying `ANIM_nla_mapping_apply_fcurve` Technical side note: `FCurve *` lost its constness due to that Pull Request: https://projects.blender.org/blender/blender/pulls/110790 --- source/blender/editors/space_graph/graph_edit.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_graph/graph_edit.cc b/source/blender/editors/space_graph/graph_edit.cc index 816c3822000..207b820b3be 100644 --- a/source/blender/editors/space_graph/graph_edit.cc +++ b/source/blender/editors/space_graph/graph_edit.cc @@ -2259,10 +2259,12 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op) const float current_frame = BKE_scene_frame_get(scene); LISTBASE_FOREACH (bAnimListElem *, ale, &anim_data) { - const FCurve *fcu = static_cast(ale->key_data); + FCurve *fcu = static_cast(ale->key_data); if (!fcu->bezt) { continue; } + AnimData *adt = ANIM_nla_mapping_get(&ac, ale); + ANIM_nla_mapping_apply_fcurve(adt, fcu, false, true); float closest_fcu_frame; if (!find_closest_frame(fcu, current_frame, next, &closest_fcu_frame)) { continue; @@ -2272,6 +2274,7 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op) closest_frame = closest_fcu_frame; found = true; } + ANIM_nla_mapping_apply_fcurve(adt, fcu, true, true); } if (!found) {