Fix for [#26420] F-Curve key handles affected by NLA strip position
authorJanne Karhu <jhkarh@gmail.com>
Wed, 9 Mar 2011 15:04:09 +0000 (15:04 +0000)
committerJanne Karhu <jhkarh@gmail.com>
Wed, 9 Mar 2011 15:04:09 +0000 (15:04 +0000)
* NLA timing was only applied to fcurve keys, but not handles, so strange things happened.
* This time tweaking was missed in selections too, so fcurve handles couldn't be selected properly either if the NLA strip was moved from frame 1.

source/blender/editors/space_graph/graph_select.c
source/blender/editors/transform/transform_conversions.c

index 18f2b4944e7bceaaae35985ea3a87503d11d77ce..85a173083d900b0b5b2f4019b186f4c47f8a35e9 100644 (file)
@@ -239,7 +239,7 @@ static void borderselect_graphkeys (bAnimContext *ac, rcti rect, short mode, sho
                 * guess when a callback might use something different
                 */
                if (adt)
-                       ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
+                       ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, incl_handles==0);
                
                /* set horizontal range (if applicable) 
                 * NOTE: these values are only used for x-range and y-range but not region 
@@ -269,7 +269,7 @@ 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);
+                       ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, incl_handles==0);
                        
                /* unapply unit corrections */
                ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, ale->key_data, ANIM_UNITCONV_RESTORE|ANIM_UNITCONV_ONLYKEYS);
@@ -987,7 +987,7 @@ static void get_nearest_fcurve_verts_list (bAnimContext *ac, int mval[2], ListBa
                
                /* apply NLA mapping to all the keyframes */
                if (adt)
-                       ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 1);
+                       ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 0, 0);
                
                if (fcu->bezt) {
                        BezTriple *bezt1=fcu->bezt, *prevbezt=NULL;
@@ -1020,7 +1020,7 @@ static void get_nearest_fcurve_verts_list (bAnimContext *ac, int mval[2], ListBa
                
                /* un-apply NLA mapping from all the keyframes */
                if (adt)
-                       ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 1);
+                       ANIM_nla_mapping_apply_fcurve(adt, ale->key_data, 1, 0);
                
                /* unapply unit corrections */
                ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, ale->key_data, ANIM_UNITCONV_RESTORE);
index 84392b1c3ccc8329f37a28a9cee5c78a398ac9e2..2c08524ae636ca3fff7253feb11f1a6ae88b9697 100644 (file)
@@ -4858,9 +4858,9 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
                                         ((cancelled == 0) || (duplicate)) )
                                {
                                        if (adt) {
-                                               ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1);
+                                               ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 0);
                                                posttrans_fcurve_clean(fcu);
-                                               ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 1);
+                                               ANIM_nla_mapping_apply_fcurve(adt, fcu, 1, 0);
                                        }
                                        else
                                                posttrans_fcurve_clean(fcu);