Applying same fix for snapping keyframes in Graph Editor
This commit is contained in:
parent
3f0227eb85
commit
1c6f8192e2
|
@ -1968,11 +1968,16 @@ static void snap_graph_keys(bAnimContext *ac, short mode)
|
|||
/* snap keyframes */
|
||||
for (ale = anim_data.first; ale; ale = ale->next) {
|
||||
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
|
||||
short mapping_flag = ANIM_get_normalization_flags(ac);
|
||||
float unit_scale = ANIM_unit_mapping_get_factor(ac->scene, ale->id, ale->key_data, mapping_flag);
|
||||
|
||||
ked.f1 = cursor_value / unit_scale;
|
||||
|
||||
|
||||
/* normalise cursor value (for normalised F-Curves display) */
|
||||
if (mode == GRAPHKEYS_SNAP_VALUE) {
|
||||
short mapping_flag = ANIM_get_normalization_flags(ac);
|
||||
float unit_scale = ANIM_unit_mapping_get_factor(ac->scene, ale->id, ale->key_data, mapping_flag);
|
||||
|
||||
ked.f1 = cursor_value / unit_scale;
|
||||
}
|
||||
|
||||
/* perform snapping */
|
||||
if (adt) {
|
||||
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
|
||||
ANIM_fcurve_keyframes_loop(&ked, ale->key_data, NULL, edit_cb, calchandles_fcurve);
|
||||
|
|
Loading…
Reference in New Issue