mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #125064 : Cursor Value to Selected wrong with Normalized FCurves
This affected cursor snapping as well as the `Jump to Keyframes` operator since both use `sum_selected_keyframes` to get the averaged values of elements. It was already taking into account the normalization factor, but the way a single `KeyframeEditData` was created from multiple `bAnimListElem` was wrong: - first, we should only add to it if we actually have some keys selected (not a problem without normalization, but with it, we would add values there - second, the offset needs to be taken into account for each selected key when adding to the absolute values Could go into LTS probably Pull Request: https://projects.blender.org/blender/blender/pulls/125221
This commit is contained in:
parent
99618031b3
commit
c788de853e
1 changed files with 5 additions and 1 deletions
|
|
@ -2112,9 +2112,13 @@ static KeyframeEditData sum_selected_keyframes(bAnimContext *ac)
|
|||
ANIM_fcurve_keyframes_loop(¤t_ked, ale->key_data, NULL, bezt_calc_average, NULL);
|
||||
}
|
||||
|
||||
if (current_ked.i1 == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ked.f1 += current_ked.f1;
|
||||
ked.i1 += current_ked.i1;
|
||||
ked.f2 += (current_ked.f2 + offset) * unit_scale;
|
||||
ked.f2 += (current_ked.f2 + offset * current_ked.i1) * unit_scale;
|
||||
ked.i2 += current_ked.i2;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue