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
This commit is contained in:
Christoph Lendenfeld
2023-08-10 11:03:01 +02:00
committed by Christoph Lendenfeld
parent 10615e98bc
commit 598af45459

View File

@@ -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<const FCurve *>(ale->key_data);
FCurve *fcu = static_cast<FCurve *>(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) {