diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/curve/curve_ops.c | 25 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 27 | ||||
-rw-r--r-- | source/blender/editors/include/ED_curve.h | 1 | ||||
-rw-r--r-- | source/blender/editors/space_api/spacetypes.c | 1 |
4 files changed, 25 insertions, 29 deletions
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index 95f3bb55ba5..8df54670bd4 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -137,6 +137,27 @@ void ED_operatortypes_curve(void) WM_operatortype_append(CURVE_OT_cyclic_toggle); } +void ED_operatormacros_curve(void) +{ + wmOperatorType *ot; + wmOperatorTypeMacro *otmacro; + + ot= WM_operatortype_append_macro("CURVE_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); + ot->description = "Duplicate curve and move"; + WM_operatortype_macro_define(ot, "CURVE_OT_duplicate"); + otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "mirror", 0); + + ot= WM_operatortype_append_macro("CURVE_OT_extrude_move", "Extrude Curve and Move", OPTYPE_UNDO|OPTYPE_REGISTER); + ot->description = "Extrude curve and move result"; + otmacro= WM_operatortype_macro_define(ot, "CURVE_OT_extrude"); + RNA_enum_set(otmacro->ptr, "type", 1); + otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_enum_set(otmacro->ptr, "proportional", 0); + RNA_boolean_set(otmacro->ptr, "mirror", 0); +} + void ED_keymap_curve(wmKeyConfig *keyconf) { wmKeyMap *keymap; @@ -214,8 +235,8 @@ void ED_keymap_curve(wmKeyConfig *keyconf) RNA_boolean_set(WM_keymap_add_item(keymap, "CURVE_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "deselect", 1); WM_keymap_add_item(keymap, "CURVE_OT_separate", PKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "CURVE_OT_extrude", EKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "CURVE_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "CURVE_OT_extrude_move", EKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CURVE_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "CURVE_OT_make_segment", FKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "CURVE_OT_cyclic_toggle", CKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "CURVE_OT_delete", XKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 1415b8965fe..a679fa3e2bf 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -4716,18 +4716,6 @@ static int extrude_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int extrude_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) -{ - if(extrude_exec(C, op) == OPERATOR_FINISHED) { - RNA_enum_set(op->ptr, "mode", TFM_TRANSLATION); - WM_operator_name_call(C, "TRANSFORM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); - - return OPERATOR_FINISHED; - } - - return OPERATOR_CANCELLED; -} - void CURVE_OT_extrude(wmOperatorType *ot) { /* identifiers */ @@ -4737,7 +4725,6 @@ void CURVE_OT_extrude(wmOperatorType *ot) /* api callbacks */ ot->exec= extrude_exec; - ot->invoke= extrude_invoke; ot->poll= ED_operator_editsurfcurve; /* flags */ @@ -5599,16 +5586,6 @@ static int duplicate_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static int duplicate_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event)) -{ - duplicate_exec(C, op); - - RNA_enum_set(op->ptr, "mode", TFM_TRANSLATION); - WM_operator_name_call(C, "TRANSFORM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr); - - return OPERATOR_FINISHED; -} - void CURVE_OT_duplicate(wmOperatorType *ot) { /* identifiers */ @@ -5618,14 +5595,10 @@ void CURVE_OT_duplicate(wmOperatorType *ot) /* api callbacks */ ot->exec= duplicate_exec; - ot->invoke= duplicate_invoke; ot->poll= ED_operator_editsurfcurve; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* to give to transform */ - RNA_def_enum(ot->srna, "mode", transform_mode_types, TFM_TRANSLATION, "Mode", ""); } /********************** delete operator *********************/ diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index 8f97d1c8602..7e7d60fdea8 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -47,6 +47,7 @@ struct BPoint; /* curve_ops.c */ void ED_operatortypes_curve(void); +void ED_operatormacros_curve(void); void ED_keymap_curve (struct wmKeyConfig *keyconf); /* editcurve.c */ diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index fbf8af514b6..7c5361c8af0 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -132,6 +132,7 @@ void ED_spacetypes_init(void) ED_operatormacros_graph(); ED_operatormacros_action(); ED_operatormacros_clip(); + ED_operatormacros_curve(); /* register dropboxes (can use macros) */ spacetypes = BKE_spacetypes_list(); |