Fix T89976: Mirror Keys By Value performs wrong scale conversion

In the graph editor, Mirror Keys by Value would convert the value to mirror
over, to account for different units for linear & rotational properties.
The conversion was done in the different direction, though, resulting in
values that were too large by a factor of (180/pi)^2.
This commit is contained in:
Sybren A. Stüvel 2021-07-29 17:02:38 +02:00
parent cae18abef4
commit c7b12e31e6
Notes: blender-bot 2023-02-14 03:31:57 +01:00
Referenced by issue #89976, Mirror Keys By Value Over Cursor Value gives outrageous results on rotation keyframes
1 changed files with 1 additions and 1 deletions

View File

@ -2447,7 +2447,7 @@ static void mirror_graph_keys(bAnimContext *ac, short mode)
float unit_scale = ANIM_unit_mapping_get_factor(
ac->scene, ale->id, ale->key_data, mapping_flag | ANIM_UNITCONV_ONLYKEYS, &offset);
ked.f1 = (cursor_value + offset) * unit_scale;
ked.f1 = (cursor_value - offset) / unit_scale;
}
/* Perform actual mirroring. */