diff options
author | Matt Ebb <matt@mke3.net> | 2009-12-24 13:39:30 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-12-24 13:39:30 +0300 |
commit | 73c62183f80d129cad61f21ec0fe16d5bbec873d (patch) | |
tree | 881c2bbdfc063399a88f3b287873ee4cadbbc041 /source | |
parent | accfa71b2cd95dbaa09172780d93b27b9eef403b (diff) |
Removed a few operators that were just used to generate popup menus and replaced with python defined menus.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/curve/curve_ops.c | 35 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 36 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_intern.h | 1 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_ops.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_snap.c | 39 |
7 files changed, 3 insertions, 117 deletions
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index be52952b474..660db2f0951 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -62,37 +62,6 @@ #include "curve_intern.h" -/**************************** menus *****************************/ - -static int specials_menu_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ - uiPopupMenu *pup; - uiLayout *layout; - - pup= uiPupMenuBegin(C, "Specials", 0); - layout= uiPupMenuLayout(pup); - uiItemO(layout, NULL, 0, "CURVE_OT_subdivide"); - uiItemO(layout, NULL, 0, "CURVE_OT_switch_direction"); - uiItemO(layout, NULL, 0, "CURVE_OT_spline_weight_set"); - uiItemO(layout, NULL, 0, "CURVE_OT_radius_set"); - uiItemO(layout, NULL, 0, "CURVE_OT_smooth"); - uiItemO(layout, NULL, 0, "CURVE_OT_smooth_radius"); - uiPupMenuEnd(C, pup); - - return OPERATOR_CANCELLED; -} - -void CURVE_OT_specials_menu(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Specials Menu"; - ot->idname= "CURVE_OT_specials_menu"; - - /* api clastbacks */ - ot->invoke= specials_menu_invoke; - ot->poll= ED_operator_editsurfcurve; -} - /************************* registration ****************************/ void ED_operatortypes_curve(void) @@ -157,8 +126,6 @@ void ED_operatortypes_curve(void) WM_operatortype_append(CURVE_OT_vertex_add); WM_operatortype_append(CURVE_OT_extrude); WM_operatortype_append(CURVE_OT_cyclic_toggle); - - WM_operatortype_append(CURVE_OT_specials_menu); } void ED_keymap_curve(wmKeyConfig *keyconf) @@ -248,7 +215,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "CURVE_OT_hide", HKEY, KM_PRESS, KM_ALT|KM_CTRL, 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, "CURVE_OT_specials_menu", WKEY, KM_PRESS, 0, 0); + WM_keymap_add_menu(keymap, "VIEW3D_MT_edit_curve_specials", WKEY, KM_PRESS, 0, 0); /* menus */ WM_keymap_add_menu(keymap, "VIEW3D_MT_hook", HKEY, KM_PRESS, KM_CTRL, 0); diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 8bacad3c132..c29214f4633 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -4035,39 +4035,3 @@ void PARTICLE_OT_edited_clear(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -/*********************** specials menu **************************/ - -static int specials_menu_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ - Scene *scene= CTX_data_scene(C); - ParticleEditSettings *pset=PE_settings(scene); - uiPopupMenu *pup; - uiLayout *layout; - - pup= uiPupMenuBegin(C, "Specials", 0); - layout= uiPupMenuLayout(pup); - - uiItemO(layout, NULL, 0, "PARTICLE_OT_rekey"); - if(pset->selectmode & SCE_SELECT_POINT) { - uiItemO(layout, NULL, 0, "PARTICLE_OT_subdivide"); - uiItemO(layout, NULL, 0, "PARTICLE_OT_select_first"); - uiItemO(layout, NULL, 0, "PARTICLE_OT_select_last"); - } - uiItemO(layout, NULL, 0, "PARTICLE_OT_remove_doubles"); - - uiPupMenuEnd(C, pup); - - return OPERATOR_CANCELLED; -} - -void PARTICLE_OT_specials_menu(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Specials Menu"; - ot->idname= "PARTICLE_OT_specials_menu"; - - /* api callbacks */ - ot->invoke= specials_menu_invoke; - ot->poll= PE_hair_poll; -} - diff --git a/source/blender/editors/physics/physics_intern.h b/source/blender/editors/physics/physics_intern.h index 085332b1788..e1b1a8b90a8 100644 --- a/source/blender/editors/physics/physics_intern.h +++ b/source/blender/editors/physics/physics_intern.h @@ -57,8 +57,6 @@ void PARTICLE_OT_brush_set(struct wmOperatorType *ot); void PARTICLE_OT_brush_edit(struct wmOperatorType *ot); void PARTICLE_OT_brush_radial_control(struct wmOperatorType *ot); -void PARTICLE_OT_specials_menu(struct wmOperatorType *ot); - void PARTICLE_OT_particle_edit_toggle(struct wmOperatorType *ot); void PARTICLE_OT_edited_clear(struct wmOperatorType *ot); diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index 09b4ebec7a2..24b3881d6b8 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -64,8 +64,6 @@ static void operatortypes_particle(void) WM_operatortype_append(PARTICLE_OT_brush_edit); WM_operatortype_append(PARTICLE_OT_brush_radial_control); - WM_operatortype_append(PARTICLE_OT_specials_menu); - WM_operatortype_append(PARTICLE_OT_particle_edit_toggle); WM_operatortype_append(PARTICLE_OT_edited_clear); @@ -113,7 +111,7 @@ static void keymap_particle(wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_brush_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE); RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_brush_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH); - WM_keymap_add_item(keymap, "PARTICLE_OT_specials_menu", WKEY, KM_PRESS, 0, 0); + WM_keymap_add_menu(keymap, "VIEW3D_MT_particle_specials", WKEY, KM_PRESS, 0, 0); ED_object_generic_keymap(keyconf, keymap, 1); } diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index b32a067206e..bf5d516c03a 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -161,7 +161,6 @@ void VIEW3D_OT_snap_selected_to_center(struct wmOperatorType *ot); void VIEW3D_OT_snap_cursor_to_grid(struct wmOperatorType *ot); void VIEW3D_OT_snap_cursor_to_selected(struct wmOperatorType *ot); void VIEW3D_OT_snap_cursor_to_active(struct wmOperatorType *ot); -void VIEW3D_OT_snap_menu(struct wmOperatorType *ot); /* space_view3d.c */ ARegion *view3d_has_buttons_region(ScrArea *sa); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 4bb65ec4ed4..c211e55d7a0 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -98,7 +98,6 @@ void view3d_operatortypes(void) WM_operatortype_append(VIEW3D_OT_snap_cursor_to_grid); WM_operatortype_append(VIEW3D_OT_snap_cursor_to_selected); WM_operatortype_append(VIEW3D_OT_snap_cursor_to_active); - WM_operatortype_append(VIEW3D_OT_snap_menu); transform_operatortypes(); } @@ -241,7 +240,7 @@ void view3d_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "VIEW3D_OT_camera_to_view", PAD0, KM_PRESS, KM_ALT|KM_CTRL, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_object_as_camera", PAD0, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "VIEW3D_OT_snap_menu", SKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_menu(keymap, "VIEW3D_MT_snap", SKEY, KM_PRESS, KM_SHIFT, 0); /* context ops */ kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index a23163f4a5c..3147abd499b 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -1112,42 +1112,3 @@ int minmax_verts(Object *obedit, float *min, float *max) return 1; } -/* ************************************************* */ - -static int snap_menu_invoke(bContext *C, wmOperator *unused, wmEvent *event) -{ - uiPopupMenu *pup= uiPupMenuBegin(C, "Snap", 0); - uiLayout *layout= uiPupMenuLayout(pup); - - uiItemO(layout, "Selected to Grid", 0, "VIEW3D_OT_snap_selected_to_grid"); - uiItemO(layout, "Selected to Cursor", 0, "VIEW3D_OT_snap_selected_to_cursor"); - uiItemO(layout, "Selected to Center", 0, "VIEW3D_OT_snap_selected_to_center"); - uiItemS(layout); - uiItemO(layout, "Cursor to Selected", 0, "VIEW3D_OT_snap_cursor_to_selected"); - uiItemO(layout, "Cursor to Grid", 0, "VIEW3D_OT_snap_cursor_to_grid"); - uiItemO(layout, "Cursor to Active", 0, "VIEW3D_OT_snap_cursor_to_active"); - - uiPupMenuEnd(C, pup); - - /* this operator is only for a menu, not used further */ - return OPERATOR_CANCELLED; -} - -/* only used as menu */ -void VIEW3D_OT_snap_menu(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Snap Menu"; - ot->description= "Display snap menu."; - ot->idname= "VIEW3D_OT_snap_menu"; - - /* api callbacks */ - ot->invoke= snap_menu_invoke; - - ot->poll= ED_operator_view3d_active; - - /* flags */ - ot->flag= 0; -} - - |