Graph Editor: Restoring most tools
authorJoshua Leung <aligorith@gmail.com>
Wed, 28 Jan 2009 09:55:36 +0000 (09:55 +0000)
committerJoshua Leung <aligorith@gmail.com>
Wed, 28 Jan 2009 09:55:36 +0000 (09:55 +0000)
* Copy/Paste still needs to be cleaned up to be functional. Auto-set preview range + View All also need some work to become functional...
* Smooth has been moved to Alt-O hotkey, as Shift-O was taken for Sample
* Renamed a few operators for DopeSheet to be more in line with Graph Editor ones, and to be less obscure.
* The 'join' and 'remove doubles' tools are not likely to be restored. I think that a few of the new tools cover this lack anyway. We can restore them if there is a real need.

* Record tool needs a rethink to be genuinely useful, so it's not included here anymore.
A note for anyone wanting to play with implementing this: store the sampled points using the new FPoint type in the FCurve instead of using BezTriples, as FPoints are used for storing sampled/baked data.

source/blender/editors/animation/keyframes_general.c
source/blender/editors/include/ED_keyframes_edit.h
source/blender/editors/space_action/action_edit.c
source/blender/editors/space_action/action_intern.h
source/blender/editors/space_action/action_ops.c
source/blender/editors/space_ipo/ipo_edit.c
source/blender/editors/space_ipo/ipo_intern.h
source/blender/editors/space_ipo/ipo_ops.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_generics.c

index 11397a1d60b4dca7c87bfab7bc457f8a7f270b11..30d05b915827e3cbb106e74e1fdf564067bf85d8 100644 (file)
@@ -152,11 +152,6 @@ void duplicate_fcurve_keys(FCurve *fcu)
 /* **************************************************** */
 /* Various Tools */
 
-// XXX - stub... until keyframing code is fixed...
-static void insert_vert_fcu(FCurve *fcu, float x, float y, short flag)
-{
-}
-
 /* Basic IPO-Curve 'cleanup' function that removes 'double points' and unnecessary keyframes on linear-segments only */
 void clean_fcurve(FCurve *fcu, float thresh)
 {
@@ -176,7 +171,7 @@ void clean_fcurve(FCurve *fcu, float thresh)
        
        /* now insert first keyframe, as it should be ok */
        bezt = old_bezts;
-       insert_vert_fcu(fcu, bezt->vec[1][0], bezt->vec[1][1], 0);
+       insert_vert_fcurve(fcu, bezt->vec[1][0], bezt->vec[1][1], 0);
        
        /* Loop through BezTriples, comparing them. Skip any that do 
         * not fit the criteria for "ok" points.
@@ -213,7 +208,7 @@ void clean_fcurve(FCurve *fcu, float thresh)
                                if (cur[1] > next[1]) {
                                        if (IS_EQT(cur[1], prev[1], thresh) == 0) {
                                                /* add new keyframe */
-                                               insert_vert_fcu(fcu, cur[0], cur[1], 0);
+                                               insert_vert_fcurve(fcu, cur[0], cur[1], 0);
                                        }
                                }
                        }
@@ -221,7 +216,7 @@ void clean_fcurve(FCurve *fcu, float thresh)
                                /* only add if values are a considerable distance apart */
                                if (IS_EQT(cur[1], prev[1], thresh) == 0) {
                                        /* add new keyframe */
-                                       insert_vert_fcu(fcu, cur[0], cur[1], 0);
+                                       insert_vert_fcurve(fcu, cur[0], cur[1], 0);
                                }
                        }
                }
@@ -231,18 +226,18 @@ void clean_fcurve(FCurve *fcu, float thresh)
                                /* does current have same value as previous and next? */
                                if (IS_EQT(cur[1], prev[1], thresh) == 0) {
                                        /* add new keyframe*/
-                                       insert_vert_fcu(fcu, cur[0], cur[1], 0);
+                                       insert_vert_fcurve(fcu, cur[0], cur[1], 0);
                                }
                                else if (IS_EQT(cur[1], next[1], thresh) == 0) {
                                        /* add new keyframe */
-                                       insert_vert_fcu(fcu, cur[0], cur[1], 0);
+                                       insert_vert_fcurve(fcu, cur[0], cur[1], 0);
                                }
                        }
                        else {  
                                /* add if value doesn't equal that of previous */
                                if (IS_EQT(cur[1], prev[1], thresh) == 0) {
                                        /* add new keyframe */
-                                       insert_vert_fcu(fcu, cur[0], cur[1], 0);
+                                       insert_vert_fcurve(fcu, cur[0], cur[1], 0);
                                }
                        }
                }
@@ -261,8 +256,7 @@ typedef struct tSmooth_Bezt {
 } tSmooth_Bezt;
 
 /* Use a weighted moving-means method to reduce intensity of fluctuations */
-//mode= pupmenu("Smooth F-Curve%t|Tweak Points%x1|Flatten Handles%x2");
-void smooth_fcurve(FCurve *fcu, short mode)
+void smooth_fcurve (FCurve *fcu)
 {
        BezTriple *bezt;
        int i, x, totSel = 0;
@@ -283,8 +277,6 @@ void smooth_fcurve(FCurve *fcu, short mode)
                }
        }
        
-       /* check if adjust values too... */
-       if (mode == 2) {
                /* if any points were selected, allocate tSmooth_Bezt points to work on */
                if (totSel >= 3) {
                        tSmooth_Bezt *tarray, *tsb;
@@ -309,51 +301,50 @@ void smooth_fcurve(FCurve *fcu, short mode)
                                }
                        }
                        
-                       /* calculate the new smoothed ipo's with weighted averages:
-                        *      - this is done with two passes
-                        *      - uses 5 points for each operation (which stores in the relevant handles)
-                        *      -       previous: w/a ratio = 3:5:2:1:1
-                        *      -       next: w/a ratio = 1:1:2:5:3
-                        */
-                       
-                       /* round 1: calculate previous and next */ 
-                       tsb= tarray;
-                       for (i=0; i < totSel; i++, tsb++) {
-                               /* don't touch end points (otherwise, curves slowly explode) */
-                               if (ELEM(i, 0, (totSel-1)) == 0) {
-                                       const tSmooth_Bezt *tP1 = tsb - 1;
-                                       const tSmooth_Bezt *tP2 = (i-2 > 0) ? (tsb - 2) : (NULL);
-                                       const tSmooth_Bezt *tN1 = tsb + 1;
-                                       const tSmooth_Bezt *tN2 = (i+2 < totSel) ? (tsb + 2) : (NULL);
-                                       
-                                       const float p1 = *tP1->h2;
-                                       const float p2 = (tP2) ? (*tP2->h2) : (*tP1->h2);
-                                       const float c1 = *tsb->h2;
-                                       const float n1 = *tN1->h2;
-                                       const float n2 = (tN2) ? (*tN2->h2) : (*tN1->h2);
-                                       
-                                       /* calculate previous and next */
-                                       *tsb->h1= (3*p2 + 5*p1 + 2*c1 + n1 + n2) / 12;
-                                       *tsb->h3= (p2 + p1 + 2*c1 + 5*n1 + 3*n2) / 12;
-                               }
-                       }
+       /* calculate the new smoothed F-Curve's with weighted averages:
+        *      - this is done with two passes
+        *      - uses 5 points for each operation (which stores in the relevant handles)
+        *      -       previous: w/a ratio = 3:5:2:1:1
+        *      -       next: w/a ratio = 1:1:2:5:3
+        */
+       
+       /* round 1: calculate previous and next */ 
+       tsb= tarray;
+       for (i=0; i < totSel; i++, tsb++) {
+               /* don't touch end points (otherwise, curves slowly explode) */
+               if (ELEM(i, 0, (totSel-1)) == 0) {
+                       const tSmooth_Bezt *tP1 = tsb - 1;
+                       const tSmooth_Bezt *tP2 = (i-2 > 0) ? (tsb - 2) : (NULL);
+                       const tSmooth_Bezt *tN1 = tsb + 1;
+                       const tSmooth_Bezt *tN2 = (i+2 < totSel) ? (tsb + 2) : (NULL);
                        
-                       /* round 2: calculate new values and reset handles */
-                       tsb= tarray;
-                       for (i=0; i < totSel; i++, tsb++) {
-                               /* calculate new position by averaging handles */
-                               *tsb->h2 = (*tsb->h1 + *tsb->h3) / 2;
-                               
-                               /* reset handles now */
-                               *tsb->h1 = *tsb->h2;
-                               *tsb->h3 = *tsb->h2;
-                       }
+                       const float p1 = *tP1->h2;
+                       const float p2 = (tP2) ? (*tP2->h2) : (*tP1->h2);
+                       const float c1 = *tsb->h2;
+                       const float n1 = *tN1->h2;
+                       const float n2 = (tN2) ? (*tN2->h2) : (*tN1->h2);
                        
-                       /* free memory required for tarray */
-                       MEM_freeN(tarray);
+                       /* calculate previous and next */
+                       *tsb->h1= (3*p2 + 5*p1 + 2*c1 + n1 + n2) / 12;
+                       *tsb->h3= (p2 + p1 + 2*c1 + 5*n1 + 3*n2) / 12;
                }
        }
        
+       /* round 2: calculate new values and reset handles */
+       tsb= tarray;
+       for (i=0; i < totSel; i++, tsb++) {
+               /* calculate new position by averaging handles */
+               *tsb->h2 = (*tsb->h1 + *tsb->h3) / 2;
+               
+               /* reset handles now */
+               *tsb->h1 = *tsb->h2;
+               *tsb->h3 = *tsb->h2;
+       }
+       
+       /* free memory required for tarray */
+       MEM_freeN(tarray);
+}
+       
        /* recalculate handles */
        calchandles_fcurve(fcu);
 }
index 958cf40b2ace52c5ec06321871dd56ea08e90a48..c0646514d1a0a3f2f6c079833e4f804437563410 100644 (file)
@@ -132,7 +132,7 @@ void delete_fcurve_keys(struct FCurve *fcu);
 void duplicate_fcurve_keys(struct FCurve *fcu);
 
 void clean_fcurve(struct FCurve *fcu, float thresh);
-void smooth_fcurve(struct FCurve *fcu, short mode);
+void smooth_fcurve(struct FCurve *fcu);
 
 /* ************************************************ */
 
index d618d2869c8582d6ad1f3d80949796d4bd71665c..3cf593d35a9585063e715dd7c5a751f603ad48bb 100644 (file)
@@ -627,6 +627,7 @@ void ACT_OT_keyframes_delete (wmOperatorType *ot)
        ot->idname= "ACT_OT_keyframes_delete";
        
        /* api callbacks */
+       ot->invoke= WM_operator_confirm;
        ot->exec= actkeys_delete_exec;
        ot->poll= ED_operator_areaactive;
        
@@ -825,8 +826,6 @@ void ACT_OT_keyframes_sample (wmOperatorType *ot)
 
 /* ******************** Set Extrapolation-Type Operator *********************** */
 
-// XXX rename this operator...
-
 /* defines for set extrapolation-type for selected keyframes tool */
 EnumPropertyItem prop_actkeys_expo_types[] = {
        {FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", "Constant Extrapolation", ""},
@@ -883,11 +882,11 @@ static int actkeys_expo_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_expotype (wmOperatorType *ot)
+void ACT_OT_keyframes_extrapolation_type (wmOperatorType *ot)
 {
        /* identifiers */
        ot->name= "Set Keyframe Extrapolation";
-       ot->idname= "ACT_OT_keyframes_expotype";
+       ot->idname= "ACT_OT_keyframes_extrapolation_type";
        
        /* api callbacks */
        ot->invoke= WM_menu_invoke;
@@ -961,11 +960,11 @@ static int actkeys_ipo_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
  
-void ACT_OT_keyframes_ipotype (wmOperatorType *ot)
+void ACT_OT_keyframes_interpolation_type (wmOperatorType *ot)
 {
        /* identifiers */
        ot->name= "Set Keyframe Interpolation";
-       ot->idname= "ACT_OT_keyframes_ipotype";
+       ot->idname= "ACT_OT_keyframes_interpolation_type";
        
        /* api callbacks */
        ot->invoke= WM_menu_invoke;
index 14cf6f82f7695830ecd8694eb4374e1a60fb52f3..591aecb061af50a567d994c72547bfefcb44e94c 100644 (file)
@@ -88,8 +88,8 @@ void ACT_OT_keyframes_clean(struct wmOperatorType *ot);
 void ACT_OT_keyframes_sample(struct wmOperatorType *ot);
 
 void ACT_OT_keyframes_handletype(struct wmOperatorType *ot);
-void ACT_OT_keyframes_ipotype(struct wmOperatorType *ot);
-void ACT_OT_keyframes_expotype(struct wmOperatorType *ot);
+void ACT_OT_keyframes_interpolation_type(struct wmOperatorType *ot);
+void ACT_OT_keyframes_extrapolation_type(struct wmOperatorType *ot);
 
 void ACT_OT_keyframes_cfrasnap(struct wmOperatorType *ot);
 void ACT_OT_keyframes_snap(struct wmOperatorType *ot);
index f3a9ceb21baab2b844135e6d3fffe1f39c4490ec..c8d9f1ca4064a1c9db0a989e87d2268b38e8a70d 100644 (file)
@@ -73,8 +73,8 @@ void action_operatortypes(void)
        WM_operatortype_append(ACT_OT_keyframes_mirror);
        WM_operatortype_append(ACT_OT_keyframes_cfrasnap);
        WM_operatortype_append(ACT_OT_keyframes_handletype);
-       WM_operatortype_append(ACT_OT_keyframes_ipotype);
-       WM_operatortype_append(ACT_OT_keyframes_expotype);
+       WM_operatortype_append(ACT_OT_keyframes_interpolation_type);
+       WM_operatortype_append(ACT_OT_keyframes_extrapolation_type);
        WM_operatortype_append(ACT_OT_keyframes_sample);
        WM_operatortype_append(ACT_OT_keyframes_clean);
        WM_operatortype_append(ACT_OT_keyframes_delete);
@@ -121,8 +121,8 @@ static void action_keymap_keyframes (wmWindowManager *wm, ListBase *keymap)
        
                /* menu + set setting */
        WM_keymap_add_item(keymap, "ACT_OT_keyframes_handletype", HKEY, KM_PRESS, 0, 0);
-       WM_keymap_add_item(keymap, "ACT_OT_keyframes_ipotype", TKEY, KM_PRESS, KM_SHIFT, 0);
-       WM_keymap_add_item(keymap, "ACT_OT_keyframes_expotype", EKEY, KM_PRESS, KM_SHIFT, 0); // temp...
+       WM_keymap_add_item(keymap, "ACT_OT_keyframes_interpolation_type", TKEY, KM_PRESS, KM_SHIFT, 0);
+       WM_keymap_add_item(keymap, "ACT_OT_keyframes_extrapolation_type", EKEY, KM_PRESS, KM_SHIFT, 0); 
        
                /* destructive */
        WM_keymap_add_item(keymap, "ACT_OT_keyframes_clean", OKEY, KM_PRESS, 0, 0);
index 98f63179d2381a7abab9fcc5565507d3438cd947..1e67b30c15a885bc7b28d3871189a0eb5bccb628 100644 (file)
@@ -480,17 +480,6 @@ static short paste_graph_keys (bAnimContext *ac)
        
        /* free temp memory */
        BLI_freelistN(&anim_data);
-       
-       /* do depsgraph updates (for 3d-view)? */
-#if 0
-       if ((ob) && (G.saction->pin==0)) {
-               if (ob->type == OB_ARMATURE)
-                       DAG_object_flush_update(G.scene, ob, OB_RECALC_OB|OB_RECALC_DATA);
-               else
-                       DAG_object_flush_update(G.scene, ob, OB_RECALC_OB);
-       }
-#endif
-
 #endif // XXX old animation system
 
        return 0;
@@ -571,6 +560,8 @@ void GRAPHEDIT_OT_keyframes_paste (wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
 }
 
+#endif // XXX code to be sanitied for new system
+
 /* ******************** Delete Keyframes Operator ************************* */
 
 static void delete_graph_keys (bAnimContext *ac)
@@ -621,6 +612,7 @@ void GRAPHEDIT_OT_keyframes_delete (wmOperatorType *ot)
        ot->idname= "GRAPHEDIT_OT_keyframes_delete";
        
        /* api callbacks */
+       ot->invoke= WM_operator_confirm;
        ot->exec= graphkeys_delete_exec;
        ot->poll= ED_operator_areaactive;
        
@@ -694,6 +686,8 @@ void GRAPHEDIT_OT_keyframes_clean (wmOperatorType *ot)
 
 /* ******************** Sample Keyframes Operator *********************** */
 
+// XXX some of the common parts (with DopeSheet) should be unified in animation module...
+
 /* little cache for values... */
 typedef struct tempFrameValCache {
        float frame, val;
@@ -810,13 +804,12 @@ void GRAPHEDIT_OT_keyframes_sample (wmOperatorType *ot)
        ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
 }
 
+
 /* ************************************************************************** */
 /* SETTINGS STUFF */
 
 /* ******************** Set Extrapolation-Type Operator *********************** */
 
-// XXX rename this operator...
-
 /* defines for set extrapolation-type for selected keyframes tool */
 EnumPropertyItem prop_graphkeys_expo_types[] = {
        {FCURVE_EXTRAPOLATE_CONSTANT, "CONSTANT", "Constant Extrapolation", ""},
@@ -871,11 +864,11 @@ static int graphkeys_expo_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
  
-void GRAPHEDIT_OT_keyframes_expotype (wmOperatorType *ot)
+void GRAPHEDIT_OT_keyframes_extrapolation_type (wmOperatorType *ot)
 {
        /* identifiers */
        ot->name= "Set Keyframe Extrapolation";
-       ot->idname= "GRAPHEDIT_OT_keyframes_expotype";
+       ot->idname= "GRAPHEDIT_OT_keyframes_extrapolation_type";
        
        /* api callbacks */
        ot->invoke= WM_menu_invoke;
@@ -889,8 +882,6 @@ void GRAPHEDIT_OT_keyframes_expotype (wmOperatorType *ot)
        RNA_def_enum(ot->srna, "type", prop_graphkeys_expo_types, 0, "Type", "");
 }
 
-#endif // XXX code to be sanitied for new system
-
 /* ******************** Set Interpolation-Type Operator *********************** */
 
 /* defines for set ipo-type for selected keyframes tool */
@@ -1337,4 +1328,54 @@ void GRAPHEDIT_OT_keyframes_mirror (wmOperatorType *ot)
        RNA_def_enum(ot->srna, "type", prop_graphkeys_mirror_types, 0, "Type", "");
 }
 
+/* ******************** Smooth Keyframes Operator *********************** */
+
+static int graphkeys_smooth_exec(bContext *C, wmOperator *op)
+{
+       bAnimContext ac;
+       ListBase anim_data = {NULL, NULL};
+       bAnimListElem *ale;
+       int filter;
+       
+       /* get editor data */
+       if (ANIM_animdata_get_context(C, &ac) == 0)
+               return OPERATOR_CANCELLED;
+       
+       /* filter data */
+       filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY);
+       ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
+       
+       /* smooth keyframes */
+       for (ale= anim_data.first; ale; ale= ale->next) {
+               /* For now, we can only smooth by flattening handles AND smoothing curve values.
+                * Perhaps the mode argument could be removed, as that functionality is offerred through 
+                * Snap->Flatten Handles anyway.
+                */
+               smooth_fcurve(ale->key_data);
+       }
+       BLI_freelistN(&anim_data);
+       
+       /* validate keyframes after editing */
+       ANIM_editkeyframes_refresh(&ac);
+       
+       /* set notifier tha things have changed */
+       ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES);
+       
+       return OPERATOR_FINISHED;
+}
+void GRAPHEDIT_OT_keyframes_smooth (wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "Smooth Keys";
+       ot->idname= "GRAPHEDIT_OT_keyframes_smooth";
+       
+       /* api callbacks */
+       ot->exec= graphkeys_smooth_exec;
+       ot->poll= ED_operator_areaactive;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/;
+}
+
 /* ************************************************************************** */
index 6978748060240a0a445f2671a2dbfcd19cc9c356..f44f2174462393ab17da946460d2f72697a7a113 100644 (file)
@@ -81,10 +81,11 @@ void GRAPHEDIT_OT_keyframes_paste(struct wmOperatorType *ot);
 void GRAPHEDIT_OT_keyframes_delete(struct wmOperatorType *ot);
 void GRAPHEDIT_OT_keyframes_clean(struct wmOperatorType *ot);
 void GRAPHEDIT_OT_keyframes_sample(struct wmOperatorType *ot);
+void GRAPHEDIT_OT_keyframes_smooth(struct wmOperatorType *ot);
 
 void GRAPHEDIT_OT_keyframes_handletype(struct wmOperatorType *ot);
 void GRAPHEDIT_OT_keyframes_interpolation_type(struct wmOperatorType *ot);
-void GRAPHEDIT_OT_keyframes_expotype(struct wmOperatorType *ot);
+void GRAPHEDIT_OT_keyframes_extrapolation_type(struct wmOperatorType *ot);
 
 void GRAPHEDIT_OT_keyframes_cfrasnap(struct wmOperatorType *ot);
 void GRAPHEDIT_OT_keyframes_snap(struct wmOperatorType *ot);
index d3143a6d605d4d17c54bab97babec6d20dd10f55..f0792658248e0ec09c610830ab34abaa38d10f50 100644 (file)
@@ -113,11 +113,12 @@ void graphedit_operatortypes(void)
        WM_operatortype_append(GRAPHEDIT_OT_keyframes_cfrasnap);
        WM_operatortype_append(GRAPHEDIT_OT_keyframes_handletype);
        WM_operatortype_append(GRAPHEDIT_OT_keyframes_interpolation_type);
-#if 0 // XXX code to be sanitied for new system        
-       WM_operatortype_append(GRAPHEDIT_OT_keyframes_expotype);
+       WM_operatortype_append(GRAPHEDIT_OT_keyframes_extrapolation_type);
        WM_operatortype_append(GRAPHEDIT_OT_keyframes_sample);
+       WM_operatortype_append(GRAPHEDIT_OT_keyframes_smooth);
        WM_operatortype_append(GRAPHEDIT_OT_keyframes_clean);
        WM_operatortype_append(GRAPHEDIT_OT_keyframes_delete);
+#if 0 // XXX code to be sanitied for new system        
        WM_operatortype_append(GRAPHEDIT_OT_keyframes_copy);
        WM_operatortype_append(GRAPHEDIT_OT_keyframes_paste);
 #endif // XXX code to be sanitied for new system
@@ -164,16 +165,18 @@ static void graphedit_keymap_keyframes (wmWindowManager *wm, ListBase *keymap)
        
        WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_handletype", HKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_interpolation_type", TKEY, KM_PRESS, KM_SHIFT, 0);
-#if 0 // XXX code to be sanitied for new system        
-       WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_expotype", EKEY, KM_PRESS, KM_SHIFT, 0); // temp...
+       WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_extrapolation_type", EKEY, KM_PRESS, KM_SHIFT, 0);
+       
        
                /* destructive */
        WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_clean", OKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_sample", OKEY, KM_PRESS, KM_SHIFT, 0);
+       WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_smooth", OKEY, KM_PRESS, KM_ALT, 0);
        
        WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_delete", XKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_delete", DELKEY, KM_PRESS, 0, 0);
        
+#if 0 // XXX code to be sanitied for new system
                /* copy/paste */
        WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_copy", CKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_paste", VKEY, KM_PRESS, KM_CTRL, 0);
index 896c03f7cac0c7c6466c1d54003f9e947143fc63..63b15fec3b819a1ef1ed93fec82c089fd10a30e8 100644 (file)
@@ -3127,7 +3127,7 @@ static void createTransActionData(bContext *C, TransInfo *t)
 
 
 
-/* Helper function for make_ipo_transdata, which is reponsible for associating
+/* Helper function for createTransGraphEditData, which is reponsible for associating
  * source data with transform data
  */
 static void bezt_to_transdata (TransData *td, TransData2D *td2d, Object *nob, float *loc, float *cent, short selected, short ishandle)
@@ -3145,7 +3145,6 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, Object *nob, fl
                td2d->loc[2] = 0.0f;
                td2d->loc2d = loc;
                
-               /*td->flag = 0;*/ /* can be set beforehand, else make sure its set to 0 */
                td->loc = td2d->loc;
                td->center[0] = get_action_frame_inv(nob, cent[0]);
                td->center[1] = cent[1];
@@ -3159,7 +3158,6 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, Object *nob, fl
                td2d->loc[2] = 0.0f;
                td2d->loc2d = loc;
                
-               /*td->flag = 0;*/ /* can be set beforehand, else make sure its set to 0 */
                td->loc = td2d->loc;
                VECCOPY(td->center, cent);
                VECCOPY(td->iloc, td->loc);
@@ -3172,7 +3170,7 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, Object *nob, fl
 
        if (selected) {
                td->flag |= TD_SELECTED;
-               td->dist= 0.0;
+               td->dist= 0.0f;
        }
        else
                td->dist= MAXFLOAT;
@@ -3574,9 +3572,7 @@ void flushTransGraphData(TransInfo *t)
                //else
                        td2d->loc2d[0]= td2d->loc[0];
                
-               /* when the icu that point comes from is a bitflag holder, don't allow adjusting values */
-               if ((td->flag & TD_TIMEONLY)==0)
-                       td2d->loc2d[1]= td2d->loc[1];
+               td2d->loc2d[1]= td2d->loc[1];
        }
 }
 
index 520efab96deac6eea7ad7f18eda5f4e2a4a555f4..6484239b0ed047dabfd421938beea65be37a12b6 100644 (file)
@@ -401,6 +401,7 @@ void recalcData(TransInfo *t)
                bAnimListElem *ale;
                int dosort = 0;
                
+               
                /* initialise relevant anim-context 'context' data from TransInfo data */
                        /* NOTE: sync this with the code in ANIM_animdata_get_context() */
                memset(&ac, 0, sizeof(bAnimContext));
@@ -422,7 +423,7 @@ void recalcData(TransInfo *t)
                /* now test if there is a need to re-sort */
                for (ale= anim_data.first; ale; ale= ale->next) {
                        FCurve *fcu= (FCurve *)ale->key_data;
-                               
+                       
                        /* watch it: if the time is wrong: do not correct handles yet */
                        if (test_time_fcurve(fcu))
                                dosort++;