diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-14 13:17:13 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-14 13:17:13 +0300 |
commit | 58f31f8a5d52ec8d043ae92a249804216f626fda (patch) | |
tree | 95fc0afa6d4e2104f03437a5ec97203e475b1e6c | |
parent | 996bc87793ebb6ad2b347c8e5fce1f2987607c58 (diff) |
Change set handle types back to menu now menus have key access - V+A, V+V, V+L, V+F
for Graph & Edit Curve view.
Editcurve can be Hkey for hide again.
-rw-r--r-- | release/scripts/ui/space_info.py | 12 | ||||
-rw-r--r-- | source/blender/editors/curve/curve_ops.c | 9 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_edit.c | 22 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_ops.c | 10 |
6 files changed, 25 insertions, 40 deletions
diff --git a/release/scripts/ui/space_info.py b/release/scripts/ui/space_info.py index 1aebe51e0d2..8d440c0a02d 100644 --- a/release/scripts/ui/space_info.py +++ b/release/scripts/ui/space_info.py @@ -250,18 +250,6 @@ class INFO_MT_surface_add(bpy.types.Menu): layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text="NURBS Sphere") layout.operator("surface.primitive_nurbs_surface_torus_add", icon='SURFACE_NTORUS', text="NURBS Torus") -class INFO_MT_curve_handle_type_set(bpy.types.Menu): - bl_idname = "INFO_MT_curve_handle_type_set" - bl_label = "Handle Type" - - def draw(self, context): - layout = self.layout - layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("curve.handle_type_set", text="Automatic").type = "AUTOMATIC" - layout.operator("curve.handle_type_set", text="Vector").type = "VECTOR" - layout.operator("curve.handle_type_set", text="Align").type = "ALIGN" - layout.operator("curve.handle_type_set", text="Free Align").type = "FREE_ALIGN" - class INFO_MT_armature_add(bpy.types.Menu): bl_idname = "INFO_MT_armature_add" diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index b454202fc11..89059c0141f 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -196,12 +196,9 @@ void ED_keymap_curve(wmKeyConfig *keyconf) keymap->poll= ED_operator_editsurfcurve; WM_keymap_add_menu(keymap, "INFO_MT_edit_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0); - /* XXX will fix it with proper defines (ton) */ - RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", HKEY, KM_PRESS, 0, 0)->ptr, "type", 5); - RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", HD_AUTO); - RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", HKEY, KM_PRESS, KM_ALT, 0)->ptr, "type", 6); - RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", VKEY, KM_PRESS, 0, 0)->ptr, "type", HD_VECT); + WM_keymap_add_item(keymap, "CURVE_OT_handle_type_set", VKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CURVE_OT_vertex_add", LEFTMOUSE, KM_CLICK, KM_CTRL, 0); WM_keymap_add_item(keymap, "CURVE_OT_select_all", AKEY, KM_PRESS, 0, 0); @@ -226,7 +223,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "TRANSFORM_OT_transform", SKEY, KM_PRESS, KM_ALT, 0)->ptr, "mode", TFM_CURVE_SHRINKFATTEN); WM_keymap_add_item(keymap, "CURVE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0); - WM_keymap_add_item(keymap, "CURVE_OT_hide", HKEY, KM_PRESS, KM_ALT|KM_CTRL, 0); + WM_keymap_add_item(keymap, "CURVE_OT_hide", HKEY, KM_PRESS, KM_ALT, 0); RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_hide", HKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0)->ptr, "unselected", 1); WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 7018ddab9fc..5fa1ebe12fb 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -3538,11 +3538,12 @@ static int set_handle_type_exec(bContext *C, wmOperator *op) void CURVE_OT_handle_type_set(wmOperatorType *ot) { - static EnumPropertyItem type_items[]= { + /* keep in sync with graphkeys_handle_type_items */ + static EnumPropertyItem editcurve_handle_type_items[]= { {HD_AUTO, "AUTOMATIC", 0, "Automatic", ""}, {HD_VECT, "VECTOR", 0, "Vector", ""}, - {5, "ALIGN", 0, "Align", ""}, - {6, "FREE_ALIGN", 0, "Free Align", ""}, + {5, "ALIGNED", 0, "Aligned", ""}, + {6, "FREE_ALIGN", 0, "Free", ""}, {3, "TOGGLE_FREE_ALIGN", 0, "Toggle Free/Align", ""}, {0, NULL, 0, NULL, NULL}}; @@ -3551,6 +3552,7 @@ void CURVE_OT_handle_type_set(wmOperatorType *ot) ot->idname= "CURVE_OT_handle_type_set"; /* api callbacks */ + ot->invoke= WM_menu_invoke; ot->exec= set_handle_type_exec; ot->poll= ED_operator_editcurve; @@ -3558,7 +3560,7 @@ void CURVE_OT_handle_type_set(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_enum(ot->srna, "type", type_items, 1, "Type", "Spline type"); + ot->prop= RNA_def_enum(ot->srna, "type", editcurve_handle_type_items, 1, "Type", "Spline type"); } /***************** make segment operator **********************/ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index a9336046ea5..e9fcb182c8f 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1352,14 +1352,6 @@ void GRAPH_OT_interpolation_type (wmOperatorType *ot) /* ******************** Set Handle-Type Operator *********************** */ -EnumPropertyItem graphkeys_handle_type_items[] = { - {HD_FREE, "FREE", 0, "Free", ""}, - {HD_VECT, "VECTOR", 0, "Vector", ""}, - {HD_ALIGN, "ALIGNED", 0, "Aligned", ""}, - {HD_AUTO, "AUTO", 0, "Auto", "Handles that are automatically adjusted upon moving the keyframe. Whole curve"}, - {HD_AUTO_ANIM, "ANIM_CLAMPED", 0, "Auto Clamped", "Auto handles clamped to not overshoot. Whole curve"}, - {0, NULL, 0, NULL, NULL}}; - /* ------------------- */ /* this function is responsible for setting handle-type of selected keyframes */ @@ -1424,14 +1416,24 @@ static int graphkeys_handletype_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } - void GRAPH_OT_handle_type (wmOperatorType *ot) + void GRAPH_OT_handle_type_set (wmOperatorType *ot) { + /* sync with editcurve_handle_type_items */ + static EnumPropertyItem graphkeys_handle_type_items[] = { + {HD_AUTO, "AUTO", 0, "Automatic", "Handles that are automatically adjusted upon moving the keyframe. Whole curve"}, + {HD_VECT, "VECTOR", 0, "Vector", ""}, + {HD_ALIGN, "ALIGNED", 0, "Aligned", ""}, + {HD_FREE, "FREE_ALIGN", 0, "Free", ""}, + {HD_AUTO_ANIM, "ANIM_CLAMPED", 0, "Auto Clamped", "Auto handles clamped to not overshoot. Whole curve"}, + {0, NULL, 0, NULL, NULL}}; + /* identifiers */ ot->name= "Set Keyframe Handle Type"; - ot->idname= "GRAPH_OT_handle_type"; + ot->idname= "GRAPH_OT_handle_type_set"; ot->description= "Set type of handle for selected keyframes"; /* api callbacks */ + ot->invoke= WM_menu_invoke; ot->exec= graphkeys_handletype_exec; ot->poll= graphop_editable_keyframes_poll; diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index 560dabbb634..55279d9ae29 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -106,7 +106,7 @@ void GRAPH_OT_bake(struct wmOperatorType *ot); void GRAPH_OT_sound_bake(struct wmOperatorType *ot); void GRAPH_OT_smooth(struct wmOperatorType *ot); -void GRAPH_OT_handle_type(struct wmOperatorType *ot); +void GRAPH_OT_handle_type_set(struct wmOperatorType *ot); void GRAPH_OT_interpolation_type(struct wmOperatorType *ot); void GRAPH_OT_extrapolation_type(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index ab28d4d72ea..bbd0df3ecd2 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -239,7 +239,7 @@ void graphedit_operatortypes(void) WM_operatortype_append(GRAPH_OT_snap); WM_operatortype_append(GRAPH_OT_mirror); WM_operatortype_append(GRAPH_OT_frame_jump); - WM_operatortype_append(GRAPH_OT_handle_type); + WM_operatortype_append(GRAPH_OT_handle_type_set); WM_operatortype_append(GRAPH_OT_interpolation_type); WM_operatortype_append(GRAPH_OT_extrapolation_type); WM_operatortype_append(GRAPH_OT_sample); @@ -332,12 +332,8 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap) WM_keymap_add_item(keymap, "GRAPH_OT_snap", SKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "GRAPH_OT_mirror", MKEY, KM_PRESS, KM_SHIFT, 0); - RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_handle_type", HKEY, KM_PRESS, 0, 0)->ptr, "type", HD_ALIGN); - RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_handle_type", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "type", HD_AUTO); - RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_handle_type", HKEY, KM_PRESS, KM_ALT, 0)->ptr, "type", HD_FREE); - RNA_enum_set(WM_keymap_add_item(keymap, "GRAPH_OT_handle_type", VKEY, KM_PRESS, 0, 0)->ptr, "type", HD_VECT); - - + WM_keymap_add_item(keymap, "GRAPH_OT_handle_type_set", VKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_interpolation_type", TKEY, KM_PRESS, KM_SHIFT, 0); /* destructive */ |