diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/mesh/mesh_ops.c | 188 | ||||
-rw-r--r-- | source/blenderplayer/bad_level_call_stubs/stubs.c | 2 |
2 files changed, 12 insertions, 178 deletions
diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 9e74c5717c6..eaaf76d7bc7 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -63,174 +63,6 @@ #include "mesh_intern.h" -/******************************** menus *************************************/ - -static int vertex_specials_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ - uiPopupMenu *pup; - uiLayout *layout; - - pup= uiPupMenuBegin(C, "Vertex Specials", 0); - layout= uiPupMenuLayout(pup); - uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN); - - uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles"); - uiItemO(layout, "Merge...", 0, "MESH_OT_merge"); - uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth"); - uiItemO(layout, "Select Vertex Path", 0, "MESH_OT_select_vertex_path"); - //uiItemO(layout, "Blend From Shape", 0, "MESH_OT_blend_from_shape"); - //uiItemO(layout, "Propagate to All Shapes", 0, "MESH_OT_shape_propagate_to_all"); - - uiPupMenuEnd(C, pup); - - return OPERATOR_CANCELLED; -} - -static void MESH_OT_vertex_specials(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Vertex Specials"; - //ot->description= "Perform special vertex operations."; - ot->idname= "MESH_OT_vertex_specials"; - - /* api callbacks */ - ot->invoke= vertex_specials_invoke; - ot->poll= ED_operator_editmesh; -} - -static int edge_specials_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ - uiPopupMenu *pup; - uiLayout *layout; - - pup= uiPupMenuBegin(C, "Edge Specials", 0); - layout= uiPupMenuLayout(pup); - uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN); - - uiItemO(layout, "Mark Seam", 0, "MESH_OT_mark_seam"); - uiItemBooleanO(layout, "Clear Seam", 0, "MESH_OT_mark_seam", "clear", 1); - uiItemEnumO(layout, "Rotate Edge CW", 0, "MESH_OT_edge_rotate", "direction", 1); - uiItemEnumO(layout, "Rotate Edge CCW", 0, "MESH_OT_edge_rotate", "direction", 2); - //uiItemO(layout, "Loopcut", 0, "MESH_OT_loop_cut"); // CutEdgeloop(em, 1); - //uiItemO(layout, "Edge Slide", 0, "MESH_OT_edge_slide"); // EdgeSlide(em, 0,0.0); - uiItemO(layout, "Edge Slide", 0, "TFM_OT_edge_slide"); - uiItemO(layout, "Edge Loop", 0, "MESH_OT_loop_multi_select"); - uiItemBooleanO(layout, "Edge Ring", 0, "MESH_OT_loop_multi_select", "ring", 1); - uiItemO(layout, NULL, 0, "MESH_OT_loop_to_region"); - uiItemO(layout, NULL, 0, "MESH_OT_region_to_loop"); - uiItemO(layout, "Mark Sharp", 0, "MESH_OT_mark_sharp"); - uiItemBooleanO(layout, "Clear Sharp", 0, "MESH_OT_mark_sharp", "clear", 1); - - uiPupMenuEnd(C, pup); - - return OPERATOR_CANCELLED; -} - -static void MESH_OT_edge_specials(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Edge Specials"; - //ot->description= "Perform special edge operations."; - ot->idname= "MESH_OT_edge_specials"; - - /* api callbacks */ - ot->invoke= edge_specials_invoke; - ot->poll= ED_operator_editmesh; -} - -static int face_specials_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ - uiPopupMenu *pup; - uiLayout *layout; - - pup= uiPupMenuBegin(C, "Face Specials", 0); - layout= uiPupMenuLayout(pup); - uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN); - - uiItemO(layout, NULL, 0, "MESH_OT_flip_normals"); - // uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em) - uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth"); - uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_flat"); - uiItemO(layout, NULL, 0, "MESH_OT_quads_convert_to_tris"); - uiItemO(layout, NULL, 0, "MESH_OT_tris_convert_to_quads"); - uiItemO(layout, NULL, 0, "MESH_OT_edge_flip"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "MESH_OT_fill"); - uiItemO(layout, NULL, 0, "MESH_OT_beauty_fill"); - - uiItemS(layout); - - // uiItemO(layout, NULL, 0, "MESH_OT_face_mode"); // mesh_set_face_flags(em, 1); - // uiItemBooleanO(layout, NULL, 0, "MESH_OT_face_mode", "clear", 1); // mesh_set_face_flags(em, 0); - // - // uiItemS(layout); - - uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_uvs_rotate", "direction"); - uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_uvs_mirror", "axis"); - uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_colors_rotate", "direction"); - uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_colors_mirror", "axis"); - - uiPupMenuEnd(C, pup); - - return OPERATOR_CANCELLED; -} - -static void MESH_OT_face_specials(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Face Specials"; - //ot->description= "Perform special face operations."; - ot->idname= "MESH_OT_face_specials"; - - /* api callbacks */ - ot->invoke= face_specials_invoke; - ot->poll= ED_operator_editmesh; -} - -static int specials_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ - uiPopupMenu *pup; - uiLayout *layout; - - pup= uiPupMenuBegin(C, "Specials", 0); - layout= uiPupMenuLayout(pup); - uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN); - - uiItemO(layout, "Subdivide", 0, "MESH_OT_subdivide"); - uiItemFloatO(layout, "Subdivide Smooth", 0, "MESH_OT_subdivide", "smoothness", 1.0f); - uiItemO(layout, "Merge...", 0, "MESH_OT_merge"); - uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles"); - uiItemO(layout, "Hide", 0, "MESH_OT_hide"); - uiItemO(layout, "Reveal", 0, "MESH_OT_reveal"); - uiItemO(layout, "Select Inverse", 0, "MESH_OT_select_inverse"); - uiItemO(layout, NULL, 0, "MESH_OT_flip_normals"); - uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth"); - // uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em) - uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth"); - uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_flat"); - //uiItemO(layout, "Blend From Shape", 0, "MESH_OT_blend_from_shape"); - //uiItemO(layout, "Propagate to All Shapes", 0, "MESH_OT_shape_propagate_to_all"); - uiItemO(layout, "Select Vertex Path", 0, "MESH_OT_select_vertex_path"); - - uiPupMenuEnd(C, pup); - - return OPERATOR_CANCELLED; -} - -static void MESH_OT_specials(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Specials"; - //ot->description= "Perform special vertice, edge or face operations."; - ot->idname= "MESH_OT_specials"; - - /* api callbacks */ - ot->invoke= specials_invoke; - ot->poll= ED_operator_editmesh; -} - /**************************** registration **********************************/ void ED_operatortypes_mesh(void) @@ -313,11 +145,6 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_vertex_color_remove); WM_operatortype_append(MESH_OT_sticky_add); WM_operatortype_append(MESH_OT_sticky_remove); - - WM_operatortype_append(MESH_OT_vertex_specials); - WM_operatortype_append(MESH_OT_edge_specials); - WM_operatortype_append(MESH_OT_face_specials); - WM_operatortype_append(MESH_OT_specials); WM_operatortype_append(MESH_OT_edgering_select); WM_operatortype_append(MESH_OT_loopcut); @@ -449,11 +276,18 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, 0, KKEY); /* menus */ - WM_keymap_add_item(keymap, "MESH_OT_vertex_specials", VKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "MESH_OT_edge_specials", EKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "MESH_OT_face_specials", FKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "MESH_OT_specials", WKEY, KM_PRESS, 0, 0); + kmi= WM_keymap_add_item(keymap, "WM_OT_call_menu", WKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "name", "VIEW3D_MT_edit_mesh_specials"); + + kmi= WM_keymap_add_item(keymap, "WM_OT_call_menu", FKEY, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "name", "VIEW3D_MT_edit_mesh_faces"); + kmi= WM_keymap_add_item(keymap, "WM_OT_call_menu", EKEY, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "name", "VIEW3D_MT_edit_mesh_edges"); + + kmi= WM_keymap_add_item(keymap, "WM_OT_call_menu", VKEY, KM_PRESS, KM_CTRL, 0); + RNA_string_set(kmi->ptr, "name", "VIEW3D_MT_edit_mesh_vertices"); + /* UV's */ WM_keymap_add_item(keymap, "UV_OT_mapping_menu", UKEY, KM_PRESS, 0, 0); } diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 8b6143467b9..ebd7b439624 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -215,4 +215,4 @@ void smoke_get_obstacle(void) {return;} void smoke_get_index(void) {return;} void smoke_step(void) {return;} -char blender_path(){return NULL;}
\ No newline at end of file +char blender_path(){return NULL;} |