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:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-10-29 22:10:52 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-10-29 22:10:52 +0400
commit16d13e0db9d75566735966d81d213958df3ca7e5 (patch)
tree90d32baaabc12a690360bea0f9129bd2c2e1b436 /source/blender/editors/space_graph/graph_select.c
parentf6e504cee9f85867554f5a0ab89b52a66c0f257e (diff)
Project Pampa request: FCurves normalized display
Added two options to a header of FCurve editor: - Normalize which makes it so every individual curve is fit into -1..1 space. - Auto-normalize, which probably is to be called "Lock" which "locks" curve normalization scale. This is useful to prevent curves from jumping around when tweaking it. It's debatable whether it need to be a button to normalize curves n purpose only, and it's fully depends on animator's workflow. Here during Project Pampa we've got Francesco who get used to auto-renormalization and Hjalti who prefers locked behavior. Docs are to be ready soon by Francesco. Thanks Brecht for the review!
Diffstat (limited to 'source/blender/editors/space_graph/graph_select.c')
-rw-r--r--source/blender/editors/space_graph/graph_select.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index ce036bec380..d0dcaf91e77 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -253,6 +253,8 @@ static void borderselect_graphkeys(bAnimContext *ac, rcti rect, short mode, shor
else
mapping_flag = ANIM_UNITCONV_ONLYKEYS;
+ mapping_flag |= ANIM_get_normalization_flags(ac);
+
/* loop over data, doing border select */
for (ale = anim_data.first; ale; ale = ale->next) {
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
@@ -996,7 +998,8 @@ static void get_nearest_fcurve_verts_list(bAnimContext *ac, const int mval[2], L
SpaceIpo *sipo = (SpaceIpo *)ac->sl;
View2D *v2d = &ac->ar->v2d;
-
+ short mapping_flag = 0;
+
/* get curves to search through
* - if the option to only show keyframes that belong to selected F-Curves is enabled,
* include the 'only selected' flag...
@@ -1004,12 +1007,13 @@ static void get_nearest_fcurve_verts_list(bAnimContext *ac, const int mval[2], L
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS);
if (sipo->flag & SIPO_SELCUVERTSONLY) // FIXME: this should really be check for by the filtering code...
filter |= ANIMFILTER_SEL;
+ mapping_flag |= ANIM_get_normalization_flags(ac);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
for (ale = anim_data.first; ale; ale = ale->next) {
FCurve *fcu = (FCurve *)ale->key_data;
AnimData *adt = ANIM_nla_mapping_get(ac, ale);
- float unit_scale = ANIM_unit_mapping_get_factor(ac->scene, ale->id, fcu, 0);
+ float unit_scale = ANIM_unit_mapping_get_factor(ac->scene, ale->id, fcu, mapping_flag);
/* apply NLA mapping to all the keyframes */
if (adt)