svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r21908:22075
[blender.git] / source / blender / editors / mesh / mesh_ops.c
1 /**
2  * $Id:
3  *
4  * ***** BEGIN GPL LICENSE BLOCK *****
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version. 
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19  *
20  * The Original Code is Copyright (C) 2009 Blender Foundation.
21  * All rights reserved.
22  *
23  * 
24  * Contributor(s): Blender Foundation
25  *
26  * ***** END GPL LICENSE BLOCK *****
27  */
28
29 #include <stdlib.h>
30 #include <math.h>
31
32 #include "MEM_guardedalloc.h"
33
34 #include "DNA_object_types.h"
35 #include "DNA_scene_types.h"
36 #include "DNA_screen_types.h"
37 #include "DNA_space_types.h"
38 #include "DNA_userdef_types.h"
39 #include "DNA_view3d_types.h"
40 #include "DNA_windowmanager_types.h"
41
42 #include "BLI_arithb.h"
43 #include "BLI_blenlib.h"
44 #include "BLI_editVert.h"
45
46 #include "BKE_context.h"
47 #include "BKE_global.h"
48 #include "BKE_mesh.h"
49 #include "BKE_utildefines.h"
50
51 #include "RNA_access.h"
52 #include "RNA_define.h"
53
54 #include "WM_api.h"
55 #include "WM_types.h"
56
57 #include "ED_mesh.h"
58 #include "ED_screen.h"
59 #include "ED_transform.h"
60 #include "ED_view3d.h"
61
62 #include "UI_interface.h"
63
64 #include "mesh_intern.h"
65
66 /******************************** menus *************************************/
67
68 static int vertex_specials_invoke(bContext *C, wmOperator *op, wmEvent *event)
69 {
70         uiPopupMenu *pup;
71         uiLayout *layout;
72
73         pup= uiPupMenuBegin(C, "Vertex Specials", 0);
74         layout= uiPupMenuLayout(pup);
75         uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
76
77         uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles");
78         uiItemO(layout, "Merge...", 0, "MESH_OT_merge");
79         uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth");
80         uiItemO(layout, "Select Vertex Path", 0, "MESH_OT_select_vertex_path"); 
81         //uiItemO(layout, "Blend From Shape", 0, "MESH_OT_blend_from_shape");
82         //uiItemO(layout, "Propagate to All Shapes", 0, "MESH_OT_shape_propagate_to_all");
83
84         uiPupMenuEnd(C, pup);
85         
86         return OPERATOR_CANCELLED;
87 }
88
89 static void MESH_OT_vertex_specials(wmOperatorType *ot)
90 {
91         /* identifiers */
92         ot->name= "Vertex Specials";
93         ot->idname= "MESH_OT_vertex_specials";
94         
95         /* api callbacks */
96         ot->invoke= vertex_specials_invoke;
97         ot->poll= ED_operator_editmesh;
98 }
99
100 static int edge_specials_invoke(bContext *C, wmOperator *op, wmEvent *event)
101 {
102         uiPopupMenu *pup;
103         uiLayout *layout;
104
105         pup= uiPupMenuBegin(C, "Edge Specials", 0);
106         layout= uiPupMenuLayout(pup);
107         uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
108
109         uiItemO(layout, "Mark Seam", 0, "MESH_OT_mark_seam");
110         uiItemBooleanO(layout, "Clear Seam", 0, "MESH_OT_mark_seam", "clear", 1);
111         uiItemEnumO(layout, "Rotate Edge CW", 0, "MESH_OT_edge_rotate", "direction", 1);
112         uiItemEnumO(layout, "Rotate Edge CCW", 0, "MESH_OT_edge_rotate", "direction", 2);
113         //uiItemO(layout, "Loopcut", 0, "MESH_OT_loop_cut"); // CutEdgeloop(em, 1);
114         //uiItemO(layout, "Edge Slide", 0, "MESH_OT_edge_slide"); // EdgeSlide(em, 0,0.0);
115         uiItemO(layout, "Edge Loop", 0, "MESH_OT_loop_multi_select");
116         uiItemBooleanO(layout, "Edge Ring", 0, "MESH_OT_loop_multi_select", "ring", 1);
117         uiItemO(layout, NULL, 0, "MESH_OT_loop_to_region");
118         uiItemO(layout, NULL, 0, "MESH_OT_region_to_loop");
119         uiItemO(layout, "Mark Sharp", 0, "MESH_OT_mark_sharp");
120         uiItemBooleanO(layout, "Clear Sharp", 0, "MESH_OT_mark_sharp", "clear", 1);
121
122         uiPupMenuEnd(C, pup);
123
124         return OPERATOR_CANCELLED;
125 }
126
127 static void MESH_OT_edge_specials(wmOperatorType *ot)
128 {
129         /* identifiers */
130         ot->name= "Edge Specials";
131         ot->idname= "MESH_OT_edge_specials";
132         
133         /* api callbacks */
134         ot->invoke= edge_specials_invoke;
135         ot->poll= ED_operator_editmesh;
136 }
137
138 static int face_specials_invoke(bContext *C, wmOperator *op, wmEvent *event)
139 {
140         uiPopupMenu *pup;
141         uiLayout *layout;
142
143         pup= uiPupMenuBegin(C, "Face Specials", 0);
144         layout= uiPupMenuLayout(pup);
145         uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
146
147         uiItemO(layout, NULL, 0, "MESH_OT_flip_normals");
148         // uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em)
149         uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth");
150         uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_flat");
151         uiItemO(layout, NULL, 0, "MESH_OT_quads_convert_to_tris");
152         uiItemO(layout, NULL, 0, "MESH_OT_tris_convert_to_quads");
153         uiItemO(layout, NULL, 0, "MESH_OT_edge_flip");
154
155         uiItemS(layout);
156
157         uiItemO(layout, NULL, 0, "MESH_OT_fill");
158         uiItemO(layout, NULL, 0, "MESH_OT_beauty_fill");
159
160         uiItemS(layout);
161
162         // uiItemO(layout, NULL, 0, "MESH_OT_face_mode"); // mesh_set_face_flags(em, 1);
163         // uiItemBooleanO(layout, NULL, 0, "MESH_OT_face_mode", "clear", 1); // mesh_set_face_flags(em, 0);
164         //
165         // uiItemS(layout);
166
167         uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_uvs_rotate", "direction");
168         uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_uvs_mirror", "axis");
169         uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_colors_rotate", "direction");
170         uiItemMenuEnumO(layout, NULL, 0, "MESH_OT_colors_mirror", "axis");
171
172         uiPupMenuEnd(C, pup);
173         
174         return OPERATOR_CANCELLED;
175 }
176
177 static void MESH_OT_face_specials(wmOperatorType *ot)
178 {
179         /* identifiers */
180         ot->name= "Face Specials";
181         ot->idname= "MESH_OT_face_specials";
182         
183         /* api callbacks */
184         ot->invoke= face_specials_invoke;
185         ot->poll= ED_operator_editmesh;
186 }
187
188 static int specials_invoke(bContext *C, wmOperator *op, wmEvent *event)
189 {
190         uiPopupMenu *pup;
191         uiLayout *layout;
192
193         pup= uiPupMenuBegin(C, "Specials", 0);
194         layout= uiPupMenuLayout(pup);
195         uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
196
197         uiItemO(layout, "Subdivide", 0, "MESH_OT_subdivide");
198         uiItemFloatO(layout, "Subdivide Smooth", 0, "MESH_OT_subdivide", "smoothness", 1.0f);
199         uiItemO(layout, "Merge...", 0, "MESH_OT_merge");
200         uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles");
201         uiItemO(layout, "Hide", 0, "MESH_OT_hide");
202         uiItemO(layout, "Reveal", 0, "MESH_OT_reveal");
203         uiItemO(layout, "Select Inverse", 0, "MESH_OT_select_inverse");
204         uiItemO(layout, NULL, 0, "MESH_OT_flip_normals");
205         uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth");
206         // uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em)
207         uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_smooth");
208         uiItemO(layout, NULL, 0, "MESH_OT_faces_shade_flat");
209         //uiItemO(layout, "Blend From Shape", 0, "MESH_OT_blend_from_shape");
210         //uiItemO(layout, "Propagate to All Shapes", 0, "MESH_OT_shape_propagate_to_all");
211         uiItemO(layout, "Select Vertex Path", 0, "MESH_OT_select_vertex_path"); 
212         
213         uiPupMenuEnd(C, pup);
214         
215         return OPERATOR_CANCELLED;
216 }
217
218 static void MESH_OT_specials(wmOperatorType *ot)
219 {
220         /* identifiers */
221         ot->name= "Specials";
222         ot->idname= "MESH_OT_specials";
223         
224         /* api callbacks */
225         ot->invoke= specials_invoke;
226         ot->poll= ED_operator_editmesh;
227 }
228
229 /**************************** registration **********************************/
230
231 void ED_operatortypes_mesh(void)
232 {
233         wmOperatorType *ot;
234         
235         WM_operatortype_append(MESH_OT_select_all_toggle);
236         WM_operatortype_append(MESH_OT_select_more);
237         WM_operatortype_append(MESH_OT_select_less);
238         WM_operatortype_append(MESH_OT_select_inverse);
239         WM_operatortype_append(MESH_OT_select_non_manifold);
240         WM_operatortype_append(MESH_OT_select_linked);
241         WM_operatortype_append(MESH_OT_select_linked_pick);
242         WM_operatortype_append(MESH_OT_select_random);
243         WM_operatortype_append(MESH_OT_selection_type);
244         WM_operatortype_append(MESH_OT_hide);
245         WM_operatortype_append(MESH_OT_reveal);
246         WM_operatortype_append(MESH_OT_select_by_number_vertices);
247         WM_operatortype_append(MESH_OT_normals_make_consistent);
248         WM_operatortype_append(MESH_OT_merge);
249         WM_operatortype_append(MESH_OT_subdivide);
250         WM_operatortype_append(MESH_OT_faces_select_linked_flat);
251         WM_operatortype_append(MESH_OT_edges_select_sharp);
252         WM_operatortype_append(MESH_OT_primitive_plane_add);
253         WM_operatortype_append(MESH_OT_primitive_cube_add);
254         WM_operatortype_append(MESH_OT_primitive_circle_add);
255         WM_operatortype_append(MESH_OT_primitive_cylinder_add);
256         WM_operatortype_append(MESH_OT_primitive_tube_add);
257         WM_operatortype_append(MESH_OT_primitive_cone_add);
258         WM_operatortype_append(MESH_OT_primitive_grid_add);
259         WM_operatortype_append(MESH_OT_primitive_monkey_add);
260         WM_operatortype_append(MESH_OT_primitive_uv_sphere_add);
261         WM_operatortype_append(MESH_OT_primitive_ico_sphere_add);
262         WM_operatortype_append(MESH_OT_fgon_clear);
263         WM_operatortype_append(MESH_OT_fgon_make);
264         WM_operatortype_append(MESH_OT_duplicate);
265         WM_operatortype_append(MESH_OT_remove_doubles);
266         WM_operatortype_append(MESH_OT_extrude);
267         WM_operatortype_append(MESH_OT_spin);
268         WM_operatortype_append(MESH_OT_screw);
269         
270         WM_operatortype_append(MESH_OT_vertices_transform_to_sphere);
271         WM_operatortype_append(MESH_OT_split);
272         WM_operatortype_append(MESH_OT_extrude_repeat);
273         WM_operatortype_append(MESH_OT_edge_rotate);
274         WM_operatortype_append(MESH_OT_select_vertex_path);
275         WM_operatortype_append(MESH_OT_loop_to_region);
276         WM_operatortype_append(MESH_OT_region_to_loop);
277         
278         WM_operatortype_append(MESH_OT_uvs_rotate);
279         WM_operatortype_append(MESH_OT_uvs_mirror);
280         WM_operatortype_append(MESH_OT_colors_rotate);
281         WM_operatortype_append(MESH_OT_colors_mirror);
282         
283         WM_operatortype_append(MESH_OT_fill);
284         WM_operatortype_append(MESH_OT_beauty_fill);
285         WM_operatortype_append(MESH_OT_quads_convert_to_tris);
286         WM_operatortype_append(MESH_OT_tris_convert_to_quads);
287         WM_operatortype_append(MESH_OT_edge_flip);
288         WM_operatortype_append(MESH_OT_faces_shade_smooth);
289         WM_operatortype_append(MESH_OT_faces_shade_flat);
290
291         WM_operatortype_append(MESH_OT_delete);
292
293         WM_operatortype_append(MESH_OT_separate);
294         WM_operatortype_append(MESH_OT_dupli_extrude_cursor);
295         WM_operatortype_append(MESH_OT_loop_select);
296         WM_operatortype_append(MESH_OT_edge_face_add);
297         WM_operatortype_append(MESH_OT_select_shortest_path);
298         WM_operatortype_append(MESH_OT_select_similar);
299         WM_operatortype_append(MESH_OT_loop_multi_select);
300         WM_operatortype_append(MESH_OT_mark_seam);
301         WM_operatortype_append(MESH_OT_mark_sharp);
302         WM_operatortype_append(MESH_OT_vertices_smooth);
303         WM_operatortype_append(MESH_OT_flip_normals);
304         WM_operatortype_append(MESH_OT_knife_cut);
305         WM_operatortype_append(MESH_OT_rip);
306         
307         WM_operatortype_append(MESH_OT_uv_texture_add);
308         WM_operatortype_append(MESH_OT_uv_texture_remove);
309         WM_operatortype_append(MESH_OT_vertex_color_add);
310         WM_operatortype_append(MESH_OT_vertex_color_remove);
311         WM_operatortype_append(MESH_OT_sticky_add);
312         WM_operatortype_append(MESH_OT_sticky_remove);
313
314         WM_operatortype_append(MESH_OT_vertex_specials);
315         WM_operatortype_append(MESH_OT_edge_specials);
316         WM_operatortype_append(MESH_OT_face_specials);
317         WM_operatortype_append(MESH_OT_specials);
318         
319         /* macros */
320         ot= WM_operatortype_append_macro("MESH_OT_duplicate_move", "Add Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER);
321         WM_operatortype_macro_define(ot, "MESH_OT_duplicate");
322         WM_operatortype_macro_define(ot, "TFM_OT_translate");
323
324         ot= WM_operatortype_append_macro("MESH_OT_rip_move", "Rip", OPTYPE_UNDO|OPTYPE_REGISTER);
325         WM_operatortype_macro_define(ot, "MESH_OT_rip");
326         WM_operatortype_macro_define(ot, "TFM_OT_translate");
327
328         ot= WM_operatortype_append_macro("MESH_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER);
329         WM_operatortype_macro_define(ot, "MESH_OT_extrude");
330         WM_operatortype_macro_define(ot, "TFM_OT_translate");
331         
332 }
333
334 /* note mesh keymap also for other space? */
335 void ED_keymap_mesh(wmWindowManager *wm)
336 {       
337         ListBase *keymap= WM_keymap_listbase(wm, "EditMesh", 0, 0);
338         wmKeymapItem *kmi;
339         
340         /* selecting */
341         /* standard mouse selection goes via space_view3d */
342         WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
343         kmi= WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0);
344         RNA_boolean_set(kmi->ptr, "extend", 1);
345         kmi= WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0);
346         RNA_boolean_set(kmi->ptr, "ring", 1);
347         kmi= WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT|KM_CTRL, 0);
348         RNA_boolean_set(kmi->ptr, "extend", 1);
349         RNA_boolean_set(kmi->ptr, "ring", 1);
350
351         WM_keymap_add_item(keymap, "MESH_OT_select_shortest_path", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
352         
353         WM_keymap_add_item(keymap, "MESH_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
354         WM_keymap_add_item(keymap, "MESH_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
355         WM_keymap_add_item(keymap, "MESH_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
356         WM_keymap_add_item(keymap, "MESH_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
357         WM_keymap_add_item(keymap, "MESH_OT_select_non_manifold", MKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0);
358         
359         WM_keymap_add_item(keymap, "MESH_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
360         WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0);
361         RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "deselect", 1);
362         
363         RNA_float_set(WM_keymap_add_item(keymap, "MESH_OT_faces_select_linked_flat", FKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0)->ptr,"sharpness",135.0);
364         RNA_float_set(WM_keymap_add_item(keymap, "MESH_OT_edges_select_sharp", SKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0)->ptr,"sharpness",135.0);
365         
366         WM_keymap_add_item(keymap, "MESH_OT_vertices_transform_to_sphere", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT , 0);
367
368         WM_keymap_add_item(keymap, "MESH_OT_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0);
369         
370         /* selection mode */
371         WM_keymap_add_item(keymap, "MESH_OT_selection_type", TABKEY, KM_PRESS, KM_CTRL, 0);
372         
373         /* hide */
374         WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, 0, 0);
375         RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
376         WM_keymap_add_item(keymap, "MESH_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
377         
378         /* tools */
379         WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0);
380         RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "inside", 1);
381         
382         WM_keymap_add_item(keymap, "MESH_OT_extrude_move", EKEY, KM_PRESS, 0, 0);
383         
384         WM_keymap_add_item(keymap, "MESH_OT_spin", RKEY, KM_PRESS, KM_ALT, 0);
385         WM_keymap_add_item(keymap, "MESH_OT_screw", NINEKEY, KM_PRESS, KM_CTRL, 0);
386         
387         WM_keymap_add_item(keymap, "MESH_OT_fill", FKEY, KM_PRESS, KM_SHIFT, 0);
388         WM_keymap_add_item(keymap, "MESH_OT_beauty_fill", FKEY, KM_PRESS, KM_ALT, 0);
389         WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0);
390         WM_keymap_add_item(keymap, "MESH_OT_tris_convert_to_quads", JKEY, KM_PRESS, KM_ALT, 0);
391         WM_keymap_add_item(keymap, "MESH_OT_edge_flip", FKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
392         
393         WM_keymap_add_item(keymap, "MESH_OT_split", FOURKEY, KM_PRESS, KM_CTRL, 0);
394         WM_keymap_add_item(keymap, "MESH_OT_extrude_repeat", FOURKEY, KM_PRESS, KM_ALT, 0);
395         WM_keymap_add_item(keymap, "MESH_OT_edge_rotate", FIVEKEY, KM_PRESS, KM_CTRL, 0);
396         
397         WM_keymap_add_item(keymap, "MESH_OT_loop_to_region",SIXKEY, KM_PRESS, KM_CTRL, 0);
398         WM_keymap_add_item(keymap, "MESH_OT_region_to_loop",SIXKEY, KM_PRESS, KM_ALT, 0);
399         
400         WM_keymap_add_item(keymap, "MESH_OT_uvs_rotate",SEVENKEY, KM_PRESS, KM_CTRL, 0);
401         WM_keymap_add_item(keymap, "MESH_OT_uvs_mirror",SEVENKEY, KM_PRESS, KM_ALT, 0);
402         WM_keymap_add_item(keymap, "MESH_OT_colors_rotate",EIGHTKEY, KM_PRESS, KM_CTRL, 0);
403         WM_keymap_add_item(keymap, "MESH_OT_colors_mirror",EIGHTKEY, KM_PRESS, KM_ALT, 0);
404
405         WM_keymap_add_item(keymap, "MESH_OT_rip_move",VKEY, KM_PRESS, 0, 0);
406         WM_keymap_add_item(keymap, "MESH_OT_merge", MKEY, KM_PRESS, KM_ALT, 0);
407
408         /* add/remove */
409         WM_keymap_add_item(keymap, "MESH_OT_edge_face_add", FKEY, KM_PRESS, 0, 0);
410         WM_keymap_add_item(keymap, "MESH_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
411         WM_keymap_add_item(keymap, "OBJECT_OT_mesh_add", AKEY, KM_PRESS, KM_SHIFT, 0);
412         WM_keymap_add_item(keymap, "MESH_OT_separate", PKEY, KM_PRESS, KM_SHIFT, 0);
413                                                 /* use KM_RELEASE because same key is used for tweaks */
414         WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", LEFTMOUSE, KM_RELEASE, KM_CTRL, 0);
415         
416         WM_keymap_add_item(keymap, "MESH_OT_delete", XKEY, KM_PRESS, 0, 0);
417         
418         WM_keymap_add_item(keymap, "MESH_OT_fgon_make", FKEY, KM_PRESS, KM_ALT, 0);
419         WM_keymap_add_item(keymap, "MESH_OT_fgon_clear", FKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
420         
421         WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0);
422
423         /* menus */
424         WM_keymap_add_item(keymap, "MESH_OT_vertex_specials", VKEY, KM_PRESS, KM_CTRL, 0);
425         WM_keymap_add_item(keymap, "MESH_OT_edge_specials", EKEY, KM_PRESS, KM_CTRL, 0);
426         WM_keymap_add_item(keymap, "MESH_OT_face_specials", FKEY, KM_PRESS, KM_CTRL, 0);
427         WM_keymap_add_item(keymap, "MESH_OT_specials", WKEY, KM_PRESS, 0, 0);
428         
429         /* UV's */
430         WM_keymap_add_item(keymap, "UV_OT_mapping_menu", UKEY, KM_PRESS, 0, 0);
431 }
432