diff options
author | Joshua Leung <aligorith@gmail.com> | 2014-04-23 08:41:30 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2014-04-23 08:49:21 +0400 |
commit | 1c6f8192e2db8622effa87095801132616f0de8b (patch) | |
tree | 75788781f4fe24eb322fdac5fd8075795ff1518a /source/blender/editors/space_graph/graph_edit.c | |
parent | 3f0227eb85b8e3133380da4a5e32626f9147f232 (diff) |
Applying same fix for snapping keyframes in Graph Editor
Diffstat (limited to 'source/blender/editors/space_graph/graph_edit.c')
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 73b28f75048..14ceec577af 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -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); |