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:38:09 +0400
committerJoshua Leung <aligorith@gmail.com>2014-04-23 08:49:20 +0400
commit3f0227eb85b8e3133380da4a5e32626f9147f232 (patch)
treeed49a722d05dee6ebb0fb14271d93a247c70d19b /source/blender
parent4609593a178c98e0c3487edafe5595c494c0c2c0 (diff)
Fix T39850: Graph Editor - 'Mirror Over First Selected Marker' mirrors over frame 0 instead
Problem was introduced back in 2.70 during Project Pampa when the FCurve Normalisation feature was introduced. The cause was that the normalised cursor value was always getting passed to the KeyframeEditData context, even when it wasn't needed.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/space_graph/graph_edit.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index 702f6af4071..73b28f75048 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -2090,12 +2090,16 @@ static void mirror_graph_keys(bAnimContext *ac, short mode)
/* mirror 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 | ANIM_UNITCONV_ONLYKEYS);
-
+
/* apply unit corrections */
- ked.f1 = cursor_value * unit_scale;
-
+ if (mode == GRAPHKEYS_MIRROR_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 | ANIM_UNITCONV_ONLYKEYS);
+
+ ked.f1 = cursor_value * unit_scale;
+ }
+
+ /* perform actual mirroring */
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);