Removed a few operators that were just used to generate popup menus and replaced with python defined menus.
This commit is contained in:
@@ -903,6 +903,24 @@ class VIEW3D_MT_particle(bpy.types.Menu):
|
||||
layout.menu("VIEW3D_MT_particle_showhide")
|
||||
|
||||
|
||||
class VIEW3D_MT_particle_specials(bpy.types.Menu):
|
||||
bl_label = "Specials"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
particle_edit = context.tool_settings.particle_edit
|
||||
|
||||
layout.operator("particle.rekey")
|
||||
|
||||
layout.separator()
|
||||
if particle_edit.selection_mode == 'POINT':
|
||||
layout.operator("particle.subdivide")
|
||||
layout.operator("particle.select_first")
|
||||
layout.operator("particle.select_last")
|
||||
|
||||
layout.operator("particle.remove_doubles")
|
||||
|
||||
|
||||
class VIEW3D_MT_particle_showhide(VIEW3D_MT_showhide):
|
||||
_operator_name = "particle"
|
||||
|
||||
@@ -1344,7 +1362,19 @@ class VIEW3D_MT_edit_curve_segments(bpy.types.Menu):
|
||||
|
||||
layout.operator("curve.subdivide")
|
||||
layout.operator("curve.switch_direction")
|
||||
|
||||
class VIEW3D_MT_edit_curve_specials(bpy.types.Menu):
|
||||
bl_label = "Specials"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
layout.operator("curve.subdivide")
|
||||
layout.operator("curve.switch_direction")
|
||||
layout.operator("curve.spline_weight_set")
|
||||
layout.operator("curve.radius_set")
|
||||
layout.operator("curve.smooth")
|
||||
layout.operator("curve.smooth_radius")
|
||||
|
||||
class VIEW3D_MT_edit_curve_showhide(VIEW3D_MT_showhide):
|
||||
_operator_name = "curve"
|
||||
@@ -1924,7 +1954,8 @@ bpy.types.register(VIEW3D_MT_sculpt) # Sculpt Menu
|
||||
|
||||
bpy.types.register(VIEW3D_MT_paint_vertex)
|
||||
|
||||
bpy.types.register(VIEW3D_MT_particle) # Particle Menu
|
||||
bpy.types.register(VIEW3D_MT_particle)# Particle Menu
|
||||
bpy.types.register(VIEW3D_MT_particle_specials)
|
||||
bpy.types.register(VIEW3D_MT_particle_showhide)
|
||||
|
||||
bpy.types.register(VIEW3D_MT_pose) # POSE Menu
|
||||
@@ -1948,6 +1979,7 @@ bpy.types.register(VIEW3D_MT_edit_mesh_showhide)
|
||||
bpy.types.register(VIEW3D_MT_edit_curve)
|
||||
bpy.types.register(VIEW3D_MT_edit_curve_ctrlpoints)
|
||||
bpy.types.register(VIEW3D_MT_edit_curve_segments)
|
||||
bpy.types.register(VIEW3D_MT_edit_curve_specials)
|
||||
bpy.types.register(VIEW3D_MT_edit_curve_showhide)
|
||||
|
||||
bpy.types.register(VIEW3D_MT_edit_surface)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user