Bugfix [#27126] Ctrl 0/1/2/3/4 not working in edit mode
authorJoshua Leung <aligorith@gmail.com>
Sat, 23 Apr 2011 11:20:30 +0000 (11:20 +0000)
committerJoshua Leung <aligorith@gmail.com>
Sat, 23 Apr 2011 11:20:30 +0000 (11:20 +0000)
Keymaps for subdivision_set operator were only added for Object mode.
Since this is useful for meshes in particular, added these in EditMode
keymap for mesh editing too.

source/blender/editors/mesh/mesh_ops.c

index 1c10128cee89560f6b217ed30820669618d9ba45..d95c71b68bacf0b919549ea6ba6c8a6ae244c903 100644 (file)
@@ -229,6 +229,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;
@@ -322,6 +323,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);
 }