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>2010-01-26 06:16:14 +0300
committerJoshua Leung <aligorith@gmail.com>2010-01-26 06:16:14 +0300
commit14d4feca576e78d3707872bfb8b29c749bb20572 (patch)
tree1f9b6fa131a1011ea6d4f60876b3fccca2ca8e78 /source/blender/editors/space_graph/graph_select.c
parente6a23762da3f6b88da21669b7ae30c834ace2f55 (diff)
Radians vs Degrees: The Second Attempt
F-Curves now internally store radians again instead of degrees. - This solves problems with inconsistencies when working with drivers. - No need to version patch old files, potentially screwing them up. As such, removed the version patching for F-Curves. - Is better suited to optionally showing radians throughout the UI instead or degrees. As a result, values are now converted on the fly in the Graph Editor for display and operators that operate on values. I've made the conversion system for this rather general, so that other unit type conversions can also be hooked up with the type conversion backend. Also, made some tweaks to F-Curve RNA wrapping to make it represent the data better. TODO: - Transform code currently still needs to be corrected to work with these changes. Currently moving keyframes for rotation curves will make them change too rapidly vertically when using degrees.
Diffstat (limited to 'source/blender/editors/space_graph/graph_select.c')
-rw-r--r--source/blender/editors/space_graph/graph_select.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index d6b7e809617..8ab39bc41ba 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -247,6 +247,9 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
FCurve *fcu= (FCurve *)ale->key_data;
+ /* apply unit corrections */
+ ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, ale->key_data, 0, 1);
+
/* apply NLA mapping to all the keyframes, since it's easier than trying to
* guess when a callback might use something different
*/
@@ -282,6 +285,9 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho
/* un-apply NLA mapping from all the keyframes */
if (adt)
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1);
+
+ /* unapply unit corrections */
+ ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, ale->key_data, 0, 1);
}
/* cleanup */
@@ -602,6 +608,9 @@ static short findnearest_fcurve_vert (bAnimContext *ac, int mval[2], FCurve **fc
FCurve *fcu= (FCurve *)ale->key_data;
AnimData *adt= ANIM_nla_mapping_get(ac, ale);
+ /* apply unit corrections */
+ ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, ale->key_data, 0, 0);
+
/* try to progressively get closer to the right point... */
if (fcu->bezt) {
BezTriple *bezt1=fcu->bezt, *prevbezt=NULL;
@@ -668,6 +677,9 @@ static short findnearest_fcurve_vert (bAnimContext *ac, int mval[2], FCurve **fc
if (adt)
ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1);
}
+
+ /* unapply unit corrections */
+ ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, ale->key_data, 1, 0);
}
/* free channels */