Merge with 2.5 -r 21619:21756.
[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         WM_operatortype_append(MESH_OT_select_all_toggle);
234         WM_operatortype_append(MESH_OT_select_more);
235         WM_operatortype_append(MESH_OT_select_less);
236         WM_operatortype_append(MESH_OT_select_inverse);
237         WM_operatortype_append(MESH_OT_select_non_manifold);
238         WM_operatortype_append(MESH_OT_select_linked);
239         WM_operatortype_append(MESH_OT_select_linked_pick);
240         WM_operatortype_append(MESH_OT_select_random);
241         WM_operatortype_append(MESH_OT_selection_type);
242         WM_operatortype_append(MESH_OT_hide);
243         WM_operatortype_append(MESH_OT_reveal);
244         WM_operatortype_append(MESH_OT_select_by_number_vertices);
245         WM_operatortype_append(MESH_OT_normals_make_consistent);
246         WM_operatortype_append(MESH_OT_merge);
247         WM_operatortype_append(MESH_OT_subdivide);
248         WM_operatortype_append(MESH_OT_faces_select_linked_flat);
249         WM_operatortype_append(MESH_OT_edges_select_sharp);
250         WM_operatortype_append(MESH_OT_primitive_plane_add);
251         WM_operatortype_append(MESH_OT_primitive_cube_add);
252         WM_operatortype_append(MESH_OT_primitive_circle_add);
253         WM_operatortype_append(MESH_OT_primitive_cylinder_add);
254         WM_operatortype_append(MESH_OT_primitive_tube_add);
255         WM_operatortype_append(MESH_OT_primitive_cone_add);
256         WM_operatortype_append(MESH_OT_primitive_grid_add);
257         WM_operatortype_append(MESH_OT_primitive_monkey_add);
258         WM_operatortype_append(MESH_OT_primitive_uv_sphere_add);
259         WM_operatortype_append(MESH_OT_primitive_ico_sphere_add);
260         WM_operatortype_append(MESH_OT_fgon_clear);
261         WM_operatortype_append(MESH_OT_fgon_make);
262         WM_operatortype_append(MESH_OT_duplicate);
263         WM_operatortype_append(MESH_OT_remove_doubles);
264         WM_operatortype_append(MESH_OT_extrude);
265         WM_operatortype_append(MESH_OT_spin);
266         WM_operatortype_append(MESH_OT_screw);
267         
268         WM_operatortype_append(MESH_OT_vertices_transform_to_sphere);
269         WM_operatortype_append(MESH_OT_split);
270         WM_operatortype_append(MESH_OT_extrude_repeat);
271         WM_operatortype_append(MESH_OT_edge_rotate);
272         WM_operatortype_append(MESH_OT_select_vertex_path);
273         WM_operatortype_append(MESH_OT_loop_to_region);
274         WM_operatortype_append(MESH_OT_region_to_loop);
275         
276         WM_operatortype_append(MESH_OT_uvs_rotate);
277         WM_operatortype_append(MESH_OT_uvs_mirror);
278         WM_operatortype_append(MESH_OT_colors_rotate);
279         WM_operatortype_append(MESH_OT_colors_mirror);
280         
281         WM_operatortype_append(MESH_OT_fill);
282         WM_operatortype_append(MESH_OT_beauty_fill);
283         WM_operatortype_append(MESH_OT_quads_convert_to_tris);
284         WM_operatortype_append(MESH_OT_tris_convert_to_quads);
285         WM_operatortype_append(MESH_OT_edge_flip);
286         WM_operatortype_append(MESH_OT_faces_shade_smooth);
287         WM_operatortype_append(MESH_OT_faces_shade_flat);
288
289         WM_operatortype_append(MESH_OT_delete);
290
291         WM_operatortype_append(MESH_OT_separate);
292         WM_operatortype_append(MESH_OT_dupli_extrude_cursor);
293         WM_operatortype_append(MESH_OT_loop_select);
294         WM_operatortype_append(MESH_OT_edge_face_add);
295         WM_operatortype_append(MESH_OT_select_shortest_path);
296         WM_operatortype_append(MESH_OT_select_similar);
297         WM_operatortype_append(MESH_OT_loop_multi_select);
298         WM_operatortype_append(MESH_OT_mark_seam);
299         WM_operatortype_append(MESH_OT_mark_sharp);
300         WM_operatortype_append(MESH_OT_vertices_smooth);
301         WM_operatortype_append(MESH_OT_flip_normals);
302         WM_operatortype_append(MESH_OT_knife_cut);
303         WM_operatortype_append(MESH_OT_rip);
304         
305         WM_operatortype_append(MESH_OT_uv_texture_add);
306         WM_operatortype_append(MESH_OT_uv_texture_remove);
307         WM_operatortype_append(MESH_OT_vertex_color_add);
308         WM_operatortype_append(MESH_OT_vertex_color_remove);
309         WM_operatortype_append(MESH_OT_sticky_add);
310         WM_operatortype_append(MESH_OT_sticky_remove);
311
312         WM_operatortype_append(MESH_OT_vertex_specials);
313         WM_operatortype_append(MESH_OT_edge_specials);
314         WM_operatortype_append(MESH_OT_face_specials);
315         WM_operatortype_append(MESH_OT_specials);
316 }
317
318 /* note mesh keymap also for other space? */
319 void ED_keymap_mesh(wmWindowManager *wm)
320 {       
321         ListBase *keymap= WM_keymap_listbase(wm, "EditMesh", 0, 0);
322         wmKeymapItem *kmi;
323         
324         /* selecting */
325         /* standard mouse selection goes via space_view3d */
326         WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT, 0);
327         kmi= WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0);
328         RNA_boolean_set(kmi->ptr, "extend", 1);
329         kmi= WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0);
330         RNA_boolean_set(kmi->ptr, "ring", 1);
331         kmi= WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT|KM_CTRL, 0);
332         RNA_boolean_set(kmi->ptr, "extend", 1);
333         RNA_boolean_set(kmi->ptr, "ring", 1);
334
335         WM_keymap_add_item(keymap, "MESH_OT_select_shortest_path", SELECTMOUSE, KM_PRESS, KM_CTRL, 0);
336         
337         WM_keymap_add_item(keymap, "MESH_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
338         WM_keymap_add_item(keymap, "MESH_OT_select_more", PADPLUSKEY, KM_PRESS, KM_CTRL, 0);
339         WM_keymap_add_item(keymap, "MESH_OT_select_less", PADMINUS, KM_PRESS, KM_CTRL, 0);
340         WM_keymap_add_item(keymap, "MESH_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0);
341         WM_keymap_add_item(keymap, "MESH_OT_select_non_manifold", MKEY, KM_PRESS, (KM_CTRL|KM_SHIFT|KM_ALT), 0);
342         
343         WM_keymap_add_item(keymap, "MESH_OT_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
344         WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, 0, 0);
345         RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_select_linked_pick", LKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "deselect", 1);
346         
347         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);
348         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);
349         
350         WM_keymap_add_item(keymap, "MESH_OT_vertices_transform_to_sphere", SKEY, KM_PRESS, KM_CTRL|KM_SHIFT , 0);
351
352         WM_keymap_add_item(keymap, "MESH_OT_select_similar", GKEY, KM_PRESS, KM_SHIFT, 0);
353         
354         /* selection mode */
355         WM_keymap_add_item(keymap, "MESH_OT_selection_type", TABKEY, KM_PRESS, KM_CTRL, 0);
356         
357         /* hide */
358         WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, 0, 0);
359         RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
360         WM_keymap_add_item(keymap, "MESH_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0);
361         
362         /* tools */
363         WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_CTRL, 0);
364         RNA_boolean_set(WM_keymap_add_item(keymap, "MESH_OT_normals_make_consistent", NKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "inside", 1);
365         
366         WM_keymap_add_item(keymap, "MESH_OT_extrude", EKEY, KM_PRESS, 0, 0);
367         
368         WM_keymap_add_item(keymap, "MESH_OT_spin", RKEY, KM_PRESS, KM_ALT, 0);
369         WM_keymap_add_item(keymap, "MESH_OT_screw", NINEKEY, KM_PRESS, KM_CTRL, 0);
370         
371         WM_keymap_add_item(keymap, "MESH_OT_fill", FKEY, KM_PRESS, KM_SHIFT, 0);
372         WM_keymap_add_item(keymap, "MESH_OT_beauty_fill", FKEY, KM_PRESS, KM_ALT, 0);
373         WM_keymap_add_item(keymap, "MESH_OT_quads_convert_to_tris", TKEY, KM_PRESS, KM_CTRL, 0);
374         WM_keymap_add_item(keymap, "MESH_OT_tris_convert_to_quads", JKEY, KM_PRESS, KM_ALT, 0);
375         WM_keymap_add_item(keymap, "MESH_OT_edge_flip", FKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
376         
377         WM_keymap_add_item(keymap, "MESH_OT_split", FOURKEY, KM_PRESS, KM_CTRL, 0);
378         WM_keymap_add_item(keymap, "MESH_OT_extrude_repeat", FOURKEY, KM_PRESS, KM_ALT, 0);
379         WM_keymap_add_item(keymap, "MESH_OT_edge_rotate", FIVEKEY, KM_PRESS, KM_CTRL, 0);
380         
381         WM_keymap_add_item(keymap, "MESH_OT_loop_to_region",SIXKEY, KM_PRESS, KM_CTRL, 0);
382         WM_keymap_add_item(keymap, "MESH_OT_region_to_loop",SIXKEY, KM_PRESS, KM_ALT, 0);
383         
384         WM_keymap_add_item(keymap, "MESH_OT_uvs_rotate",SEVENKEY, KM_PRESS, KM_CTRL, 0);
385         WM_keymap_add_item(keymap, "MESH_OT_uvs_mirror",SEVENKEY, KM_PRESS, KM_ALT, 0);
386         WM_keymap_add_item(keymap, "MESH_OT_colors_rotate",EIGHTKEY, KM_PRESS, KM_CTRL, 0);
387         WM_keymap_add_item(keymap, "MESH_OT_colors_mirror",EIGHTKEY, KM_PRESS, KM_ALT, 0);
388
389         WM_keymap_add_item(keymap, "MESH_OT_rip",VKEY, KM_PRESS, 0, 0);
390         WM_keymap_add_item(keymap, "MESH_OT_merge", MKEY, KM_PRESS, KM_ALT, 0);
391
392         /* add/remove */
393         WM_keymap_add_item(keymap, "MESH_OT_edge_face_add", FKEY, KM_PRESS, 0, 0);
394         WM_keymap_add_item(keymap, "MESH_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0);
395         WM_keymap_add_item(keymap, "OBJECT_OT_mesh_add", AKEY, KM_PRESS, KM_SHIFT, 0);
396         WM_keymap_add_item(keymap, "MESH_OT_separate", PKEY, KM_PRESS, KM_SHIFT, 0);
397                                                 /* use KM_RELEASE because same key is used for tweaks */
398         WM_keymap_add_item(keymap, "MESH_OT_dupli_extrude_cursor", LEFTMOUSE, KM_RELEASE, KM_CTRL, 0);
399         
400         WM_keymap_add_item(keymap, "MESH_OT_delete", XKEY, KM_PRESS, 0, 0);
401         
402         WM_keymap_add_item(keymap, "MESH_OT_fgon_make", FKEY, KM_PRESS, KM_ALT, 0);
403         WM_keymap_add_item(keymap, "MESH_OT_fgon_clear", FKEY, KM_PRESS, KM_SHIFT|KM_ALT, 0);
404         
405         WM_keymap_add_item(keymap, "MESH_OT_knife_cut", LEFTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0);
406
407         /* menus */
408         WM_keymap_add_item(keymap, "MESH_OT_vertex_specials", VKEY, KM_PRESS, KM_CTRL, 0);
409         WM_keymap_add_item(keymap, "MESH_OT_edge_specials", EKEY, KM_PRESS, KM_CTRL, 0);
410         WM_keymap_add_item(keymap, "MESH_OT_face_specials", FKEY, KM_PRESS, KM_CTRL, 0);
411         WM_keymap_add_item(keymap, "MESH_OT_specials", WKEY, KM_PRESS, 0, 0);
412         
413         /* UV's */
414         WM_keymap_add_item(keymap, "UV_OT_mapping_menu", UKEY, KM_PRESS, 0, 0);
415 }
416