svn merge ^/trunk/blender -r43420:43436
[blender.git] / source / blender / editors / mesh / mesh_ops.c
index 90b3d45deb7df75adac511978306f5754dc32332..1e14fcdd580b69adfb44b16a0af1c2ba60112997 100644 (file)
@@ -57,6 +57,7 @@
 
 /**************************** registration **********************************/
 
+void EXPORT_MESH_OT_wavefront(wmOperatorType *ot);
 void ED_operatortypes_mesh(void)
 {
        WM_operatortype_append(MESH_OT_select_all);
@@ -69,6 +70,7 @@ void ED_operatortypes_mesh(void)
        WM_operatortype_append(MESH_OT_hide);
        WM_operatortype_append(MESH_OT_reveal);
        WM_operatortype_append(MESH_OT_select_by_number_vertices);
+       WM_operatortype_append(MESH_OT_select_loose_verts);
        WM_operatortype_append(MESH_OT_select_mirror);
        WM_operatortype_append(MESH_OT_normals_make_consistent);
        WM_operatortype_append(MESH_OT_merge);
@@ -84,16 +86,18 @@ void ED_operatortypes_mesh(void)
        WM_operatortype_append(MESH_OT_primitive_monkey_add);
        WM_operatortype_append(MESH_OT_primitive_uv_sphere_add);
        WM_operatortype_append(MESH_OT_primitive_ico_sphere_add);
-       WM_operatortype_append(MESH_OT_fgon_clear);
-       WM_operatortype_append(MESH_OT_fgon_make);
        WM_operatortype_append(MESH_OT_duplicate);
        WM_operatortype_append(MESH_OT_remove_doubles);
        WM_operatortype_append(MESH_OT_vertices_sort);
        WM_operatortype_append(MESH_OT_vertices_randomize);
-       WM_operatortype_append(MESH_OT_extrude);
        WM_operatortype_append(MESH_OT_spin);
        WM_operatortype_append(MESH_OT_screw);
-       
+
+       WM_operatortype_append(MESH_OT_extrude_region);
+       WM_operatortype_append(MESH_OT_extrude_faces_indiv);
+       WM_operatortype_append(MESH_OT_extrude_edges_indiv);
+       WM_operatortype_append(MESH_OT_extrude_verts_indiv);
+
        WM_operatortype_append(MESH_OT_split);
        WM_operatortype_append(MESH_OT_extrude_repeat);
        WM_operatortype_append(MESH_OT_edge_rotate);
@@ -103,9 +107,9 @@ void ED_operatortypes_mesh(void)
        WM_operatortype_append(MESH_OT_select_axis);
        
        WM_operatortype_append(MESH_OT_uvs_rotate);
-       WM_operatortype_append(MESH_OT_uvs_mirror);
+       WM_operatortype_append(MESH_OT_uvs_reverse);
        WM_operatortype_append(MESH_OT_colors_rotate);
-       WM_operatortype_append(MESH_OT_colors_mirror);
+       WM_operatortype_append(MESH_OT_colors_reverse);
        
        WM_operatortype_append(MESH_OT_fill);
        WM_operatortype_append(MESH_OT_beautify_fill);
@@ -130,7 +134,7 @@ void ED_operatortypes_mesh(void)
        WM_operatortype_append(MESH_OT_vertices_smooth);
        WM_operatortype_append(MESH_OT_noise);
        WM_operatortype_append(MESH_OT_flip_normals);
-       WM_operatortype_append(MESH_OT_knife_cut);
+       //WM_operatortype_append(MESH_OT_knife_cut);
        WM_operatortype_append(MESH_OT_rip);
        WM_operatortype_append(MESH_OT_blend_from_shape);
        WM_operatortype_append(MESH_OT_shape_propagate_to_all);
@@ -148,6 +152,15 @@ void ED_operatortypes_mesh(void)
 
        WM_operatortype_append(MESH_OT_solidify);
        WM_operatortype_append(MESH_OT_select_nth);
+       WM_operatortype_append(MESH_OT_vert_connect);
+       WM_operatortype_append(MESH_OT_knifetool);
+
+       WM_operatortype_append(MESH_OT_bevel);
+
+       WM_operatortype_append(MESH_OT_select_next_loop);
+       
+       WM_operatortype_append(EXPORT_MESH_OT_wavefront);
+       WM_operatortype_append(MESH_OT_bridge_edge_loops);
 
 #ifdef WITH_GAMEENGINE
        WM_operatortype_append(MESH_OT_navmesh_make);
@@ -163,7 +176,7 @@ static int ED_operator_editmesh_face_select(bContext *C)
 {
        Object *obedit= CTX_data_edit_object(C);
        if(obedit && obedit->type==OB_MESH) {
-               EditMesh *em = ((Mesh *)obedit->data)->edit_mesh;
+               BMEditMesh *em = ((Mesh *)obedit->data)->edit_btmesh;
                if (em && em->selectmode & SCE_SELECT_FACE) {
                        return 1;
                }
@@ -199,31 +212,28 @@ void ED_operatormacros_mesh(void)
 
        ot= WM_operatortype_append_macro("MESH_OT_extrude_region_move", "Extrude Region and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
        ot->description = "Extrude region and move result";
-       otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude");
-       RNA_enum_set(otmacro->ptr, "type", 1);
+       otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude_region");
        otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
        RNA_enum_set(otmacro->ptr, "proportional", 0);
        RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
 
        ot= WM_operatortype_append_macro("MESH_OT_extrude_faces_move", "Extrude Individual Faces and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
        ot->description = "Extrude faces and move result";
-       otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude");
-       RNA_enum_set(otmacro->ptr, "type", 2);
+       otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude_faces_indiv");
        otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_shrink_fatten");
        RNA_enum_set(otmacro->ptr, "proportional", 0);
        RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
 
        ot= WM_operatortype_append_macro("MESH_OT_extrude_edges_move", "Extrude Only Edges and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
        ot->description = "Extrude edges and move result";
-       otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude");
-       RNA_enum_set(otmacro->ptr, "type", 3);
+       otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude_edges_indiv");
        otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
        RNA_enum_set(otmacro->ptr, "proportional", 0);
        RNA_boolean_set(otmacro->ptr, "mirror", FALSE);
 
        ot= WM_operatortype_append_macro("MESH_OT_extrude_vertices_move", "Extrude Only Vertices and Move", OPTYPE_UNDO|OPTYPE_REGISTER);
        ot->description = "Extrude vertices and move result";
-       otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude");
+       otmacro= WM_operatortype_macro_define(ot, "MESH_OT_extrude_verts_indiv");
        RNA_enum_set(otmacro->ptr, "type", 4);
        otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate");
        RNA_enum_set(otmacro->ptr, "proportional", 0);
@@ -300,6 +310,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        
        WM_keymap_add_item(keymap, "MESH_OT_fill", FKEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "MESH_OT_beautify_fill", FKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
+
        WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "MESH_OT_tris_convert_to_quads", JKEY, KM_PRESS, KM_ALT, 0);
        WM_keymap_add_item(keymap, "MESH_OT_edge_flip", FKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
@@ -317,7 +328,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        WM_keymap_add_menu(keymap, "INFO_MT_mesh_add", AKEY, KM_PRESS, KM_SHIFT, 0);
        
        WM_keymap_add_item(keymap, "MESH_OT_separate", PKEY, KM_PRESS, 0, 0);
-       WM_keymap_add_item(keymap, "MESH_OT_split", YKEY, KM_PRESS, 0, 0);
+       WM_keymap_add_item(keymap, "MESH_OT_vert_connect", YKEY, KM_PRESS, 0, 0);
 
        /* use KM_CLICK because same key is used for tweaks */
        kmi = WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", ACTIONMOUSE, KM_CLICK, KM_CTRL, 0);
@@ -328,8 +339,8 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "MESH_OT_delete", XKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "MESH_OT_delete", DELKEY, KM_PRESS, 0, 0);
        
-       WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, 0, KKEY);
-       RNA_enum_set(WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, KM_SHIFT, KKEY)->ptr, "type", 2/*KNIFE_MIDPOINT*/);
+       WM_keymap_add_item(keymap, "MESH_OT_knifetool", KKEY, KM_PRESS, 0, 0);
+       //RNA_enum_set(WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, KM_SHIFT, KKEY)->ptr, "type", 2/*KNIFE_MIDPOINT*/);
        
        WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
 
@@ -349,5 +360,6 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        }
        
        ED_object_generic_keymap(keyconf, keymap, 3);
+       knifetool_modal_keymap(keyconf);
 }