diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-01-28 12:55:36 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-01-28 12:55:36 +0300 |
commit | 5b14573d0b702f08a656b04285a7a8281cdbdca5 (patch) | |
tree | 25652e71f163a0139358b82ca892231603712be1 /source | |
parent | 9e8a60c79640a2cf744206d1c5e539dcb164647b (diff) |
Graph Editor: Restoring most tools
* 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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/animation/keyframes_general.c | 101 | ||||
-rw-r--r-- | source/blender/editors/include/ED_keyframes_edit.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_edit.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_intern.h | 4 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_ops.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_ipo/ipo_edit.c | 75 | ||||
-rw-r--r-- | source/blender/editors/space_ipo/ipo_intern.h | 3 | ||||
-rw-r--r-- | source/blender/editors/space_ipo/ipo_ops.c | 11 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 10 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 3 |
10 files changed, 130 insertions, 98 deletions
diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 11397a1d60b..30d05b91582 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -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); } diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h index 958cf40b2ac..c0646514d1a 100644 --- a/source/blender/editors/include/ED_keyframes_edit.h +++ b/source/blender/editors/include/ED_keyframes_edit.h @@ -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); /* ************************************************ */ diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index d618d2869c8..3cf593d35a9 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -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; diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h index 14cf6f82f76..591aecb061a 100644 --- a/source/blender/editors/space_action/action_intern.h +++ b/source/blender/editors/space_action/action_intern.h @@ -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); diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index f3a9ceb21ba..c8d9f1ca406 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -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); diff --git a/source/blender/editors/space_ipo/ipo_edit.c b/source/blender/editors/space_ipo/ipo_edit.c index 98f63179d23..1e67b30c15a 100644 --- a/source/blender/editors/space_ipo/ipo_edit.c +++ b/source/blender/editors/space_ipo/ipo_edit.c @@ -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*/; +} + /* ************************************************************************** */ diff --git a/source/blender/editors/space_ipo/ipo_intern.h b/source/blender/editors/space_ipo/ipo_intern.h index 69787480602..f44f2174462 100644 --- a/source/blender/editors/space_ipo/ipo_intern.h +++ b/source/blender/editors/space_ipo/ipo_intern.h @@ -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); diff --git a/source/blender/editors/space_ipo/ipo_ops.c b/source/blender/editors/space_ipo/ipo_ops.c index d3143a6d605..f0792658248 100644 --- a/source/blender/editors/space_ipo/ipo_ops.c +++ b/source/blender/editors/space_ipo/ipo_ops.c @@ -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); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 896c03f7cac..63b15fec3b8 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -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]; } } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 520efab96de..6484239b0ed 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -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++; |