Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2014-04-23 08:41:30 +0400
committerJoshua Leung <aligorith@gmail.com>2014-04-23 08:49:21 +0400
commit1c6f8192e2db8622effa87095801132616f0de8b (patch)
tree75788781f4fe24eb322fdac5fd8075795ff1518a /source/blender
parent3f0227eb85b8e3133380da4a5e32626f9147f232 (diff)
Applying same fix for snapping keyframes in Graph Editor
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_graph/graph_edit.c15
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);