=bmesh= merge from trunk at r36529
[blender.git] / source / blender / editors / mesh / mesh_ops.c
index d0ee4f78fd86954012ed32c1136688083ddb0078..38e57e0233943471b98ef2116e0d17c2a0ee57fa 100644 (file)
  * ***** END GPL LICENSE BLOCK *****
  */
 
+/** \file blender/editors/mesh/mesh_ops.c
+ *  \ingroup edmesh
+ */
+
+
 #include <stdlib.h>
 #include <math.h>
 
@@ -54,6 +59,7 @@
 
 /**************************** registration **********************************/
 
+void EXPORT_MESH_OT_wavefront(wmOperatorType *ot);
 void ED_operatortypes_mesh(void)
 {
        WM_operatortype_append(MESH_OT_select_all);
@@ -152,6 +158,8 @@ void ED_operatortypes_mesh(void)
        WM_operatortype_append(MESH_OT_bevel);
 
        WM_operatortype_append(MESH_OT_select_next_loop);
+       
+       WM_operatortype_append(EXPORT_MESH_OT_wavefront);
 }
 
 #if 0 /* UNUSED, remove? */
@@ -176,7 +184,8 @@ void ED_operatormacros_mesh(void)
        ot= WM_operatortype_append_macro("MESH_OT_loopcut_slide", "Loop Cut and Slide", OPTYPE_UNDO|OPTYPE_REGISTER);
        ot->description = "Cut mesh loop and slide it";
        WM_operatortype_macro_define(ot, "MESH_OT_loopcut");
-       WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide");
+       otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_edge_slide");
+       RNA_struct_idprops_unset(otmacro->ptr, "release_confirm");
 
        ot= WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
        ot->description = "Duplicate mesh and move";
@@ -227,6 +236,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
 {      
        wmKeyMap *keymap;
        wmKeyMapItem *kmi;
+       int i;
        
        keymap= WM_keymap_find(keyconf, "Mesh", 0, 0);
        keymap->poll= ED_operator_editmesh;
@@ -280,7 +290,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_sort_faces", FKEY, KM_PRESS, KM_ALT|KM_CTRL, 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);
@@ -321,6 +331,12 @@ void ED_keymap_mesh(wmKeyConfig *keyconf)
        WM_keymap_add_menu(keymap, "VIEW3D_MT_uv_map", UKEY, KM_PRESS, 0, 0);
        WM_keymap_add_menu(keymap, "VIEW3D_MT_vertex_group", GKEY, KM_PRESS, KM_CTRL, 0);
        
+       /* useful stuff from object-mode */
+       for (i=0; i<=5; i++) {
+               kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", ZEROKEY+i, KM_PRESS, KM_CTRL, 0);
+               RNA_int_set(kmi->ptr, "level", i);
+       }
+       
        ED_object_generic_keymap(keyconf, keymap, 3);
 }