Keyframing Bugfixes and Feature Requests:
[blender.git] / release / scripts / ui / space_userpref.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2 #
3 #  This program is free software; you can redistribute it and/or
4 #  modify it under the terms of the GNU General Public License
5 #  as published by the Free Software Foundation; either version 2
6 #  of the License, or (at your option) any later version.
7 #
8 #  This program is distributed in the hope that it will be useful,
9 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #  GNU General Public License for more details.
12 #
13 #  You should have received a copy of the GNU General Public License
14 #  along with this program; if not, write to the Free Software Foundation,
15 #  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
16 #
17 # ##### END GPL LICENSE BLOCK #####
18
19 # <pep8 compliant>
20 import bpy
21
22
23 class USERPREF_HT_header(bpy.types.Header):
24     bl_space_type = 'USER_PREFERENCES'
25
26     def draw(self, context):
27         layout = self.layout
28         layout.template_header(menus=False)
29
30         userpref = context.user_preferences
31
32         layout.operator_context = 'EXEC_AREA'
33         layout.operator("wm.save_homefile", text="Save As Default")
34
35         if userpref.active_section == 'INPUT':
36             layout.operator_context = 'INVOKE_DEFAULT'
37             layout.operator("wm.keyconfig_export", "Export Key Configuration...").path = "keymap.py"
38
39
40 class USERPREF_PT_tabs(bpy.types.Panel):
41     bl_label = ""
42     bl_space_type = 'USER_PREFERENCES'
43     bl_region_type = 'WINDOW'
44     bl_show_header = False
45
46     def draw(self, context):
47         layout = self.layout
48
49         userpref = context.user_preferences
50
51         layout.prop(userpref, "active_section", expand=True)
52
53
54 class USERPREF_PT_interface(bpy.types.Panel):
55     bl_space_type = 'USER_PREFERENCES'
56     bl_label = "Interface"
57     bl_region_type = 'WINDOW'
58     bl_show_header = False
59
60     def poll(self, context):
61         userpref = context.user_preferences
62         return (userpref.active_section == 'INTERFACE')
63
64     def draw(self, context):
65         layout = self.layout
66
67         userpref = context.user_preferences
68         view = userpref.view
69
70         split = layout.split()
71
72         column = split.column()
73         colsplit = column.split(percentage=0.85)
74
75         col = colsplit.column()
76         col.label(text="Display:")
77         col.prop(view, "tooltips")
78         col.prop(view, "display_object_info", text="Object Info")
79         col.prop(view, "use_large_cursors")
80         col.prop(view, "show_view_name", text="View Name")
81         col.prop(view, "show_playback_fps", text="Playback FPS")
82         col.prop(view, "global_scene")
83         col.prop(view, "pin_floating_panels")
84         col.prop(view, "object_origin_size")
85
86         col.separator()
87         col.separator()
88         col.separator()
89
90         col.prop(view, "show_mini_axis", text="Display Mini Axis")
91         sub = col.column()
92         sub.enabled = view.show_mini_axis
93         sub.prop(view, "mini_axis_size", text="Size")
94         sub.prop(view, "mini_axis_brightness", text="Brightness")
95
96         column = split.column()
97         colsplit = column.split(percentage=0.85)
98
99         col = colsplit.column()
100         col.label(text="View Manipulation:")
101         col.prop(view, "auto_depth")
102         col.prop(view, "global_pivot")
103         col.prop(view, "zoom_to_mouse")
104         col.prop(view, "rotate_around_selection")
105
106         col.separator()
107
108         col.prop(view, "auto_perspective")
109         col.prop(view, "smooth_view")
110         col.prop(view, "rotation_angle")
111
112         column = split.column()
113         colsplit = column.split(percentage=0.85)
114
115         col = colsplit.column()
116
117         #Toolbox doesn't exist yet
118         #col.label(text="Toolbox:")
119         #col.prop(view, "use_column_layout")
120         #col.label(text="Open Toolbox Delay:")
121         #col.prop(view, "open_left_mouse_delay", text="Hold LMB")
122         #col.prop(view, "open_right_mouse_delay", text="Hold RMB")
123
124         #Manipulator
125         col.prop(view, "use_manipulator")
126         sub = col.column()
127         sub.enabled = view.use_manipulator
128         sub.prop(view, "manipulator_size", text="Size")
129         sub.prop(view, "manipulator_handle_size", text="Handle Size")
130         sub.prop(view, "manipulator_hotspot", text="Hotspot")
131
132         col.separator()
133         col.separator()
134         col.separator()
135
136         col.label(text="Menus:")
137         col.prop(view, "open_mouse_over")
138         col.label(text="Menu Open Delay:")
139         col.prop(view, "open_toplevel_delay", text="Top Level")
140         col.prop(view, "open_sublevel_delay", text="Sub Level")
141
142
143 class USERPREF_PT_edit(bpy.types.Panel):
144     bl_space_type = 'USER_PREFERENCES'
145     bl_label = "Edit"
146     bl_region_type = 'WINDOW'
147     bl_show_header = False
148
149     def poll(self, context):
150         userpref = context.user_preferences
151         return (userpref.active_section == 'EDITING')
152
153     def draw(self, context):
154         layout = self.layout
155
156         userpref = context.user_preferences
157         edit = userpref.edit
158
159         split = layout.split()
160
161         column = split.column()
162         colsplit = column.split(percentage=0.85)
163
164         col = colsplit.column()
165         col.label(text="Link Materials To:")
166         col.row().prop(edit, "material_link", expand=True)
167
168         col.separator()
169         col.separator()
170         col.separator()
171
172         col.label(text="New Objects:")
173         col.prop(edit, "enter_edit_mode")
174         col.label(text="Align To:")
175         col.row().prop(edit, "object_align", expand=True)
176
177         col.separator()
178         col.separator()
179         col.separator()
180
181         col.label(text="Undo:")
182         col.prop(edit, "global_undo")
183         col.prop(edit, "undo_steps", text="Steps")
184         col.prop(edit, "undo_memory_limit", text="Memory Limit")
185
186         column = split.column()
187         colsplit = column.split(percentage=0.85)
188
189         col = colsplit.column()
190         col.label(text="Snap:")
191         col.prop(edit, "snap_translate", text="Translate")
192         col.prop(edit, "snap_rotate", text="Rotate")
193         col.prop(edit, "snap_scale", text="Scale")
194         col.separator()
195         col.separator()
196         col.separator()
197         col.label(text="Grease Pencil:")
198         col.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
199         col.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
200         #col.prop(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
201         col.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
202         col.prop(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
203
204         column = split.column()
205         colsplit = column.split(percentage=0.85)
206
207         col = colsplit.column()
208         col.label(text="Keyframing:")
209         col.prop(edit, "use_visual_keying")
210         col.prop(edit, "keyframe_insert_needed", text="Only Insert Needed")
211
212         col.separator()
213
214         col.label(text="New F-Curve Defaults:")
215         col.prop(edit, "new_interpolation_type", text="Interpolation")
216         col.prop(edit, "insertkey_xyz_to_rgb", text="XYZ to RGB")
217
218         col.separator()
219
220         col.prop(edit, "auto_keying_enable", text="Auto Keyframing:")
221
222         sub = col.column()
223
224         sub.active = edit.auto_keying_enable
225         sub.prop(edit, "auto_keyframe_insert_keyingset", text="Only Insert for Keying Set")
226         sub.prop(edit, "auto_keyframe_insert_available", text="Only Insert Available")
227
228         col.separator()
229         col.separator()
230         col.separator()
231
232         col.label(text="Transform:")
233         col.prop(edit, "drag_immediately")
234
235         col.separator()
236         col.separator()
237         col.separator()
238
239         column = split.column()
240         colsplit = column.split(percentage=0.85)
241
242         col = colsplit.column()
243         col.label(text="Duplicate Data:")
244         col.prop(edit, "duplicate_mesh", text="Mesh")
245         col.prop(edit, "duplicate_surface", text="Surface")
246         col.prop(edit, "duplicate_curve", text="Curve")
247         col.prop(edit, "duplicate_text", text="Text")
248         col.prop(edit, "duplicate_metaball", text="Metaball")
249         col.prop(edit, "duplicate_armature", text="Armature")
250         col.prop(edit, "duplicate_lamp", text="Lamp")
251         col.prop(edit, "duplicate_material", text="Material")
252         col.prop(edit, "duplicate_texture", text="Texture")
253         col.prop(edit, "duplicate_fcurve", text="F-Curve")
254         col.prop(edit, "duplicate_action", text="Action")
255         col.prop(edit, "duplicate_particle", text="Particle")
256
257
258 class USERPREF_PT_system(bpy.types.Panel):
259     bl_space_type = 'USER_PREFERENCES'
260     bl_label = "System"
261     bl_region_type = 'WINDOW'
262     bl_show_header = False
263
264     def poll(self, context):
265         userpref = context.user_preferences
266         return (userpref.active_section == 'SYSTEM')
267
268     def draw(self, context):
269         layout = self.layout
270
271         userpref = context.user_preferences
272         system = userpref.system
273         lamp0 = system.solid_lights[0]
274         lamp1 = system.solid_lights[1]
275         lamp2 = system.solid_lights[2]
276
277         split = layout.split()
278
279         column = split.column()
280         colsplit = column.split(percentage=0.85)
281
282         col = colsplit.column()
283         col.label(text="General:")
284         col.prop(system, "dpi")
285         col.prop(system, "frame_server_port")
286         col.prop(system, "scrollback", text="Console Scrollback")
287         col.prop(system, "auto_run_python_scripts")
288
289         col.separator()
290         col.separator()
291         col.separator()
292
293         col.label(text="Sound:")
294         col.row().prop(system, "audio_device", expand=True)
295         sub = col.column()
296         sub.active = system.audio_device != 'NONE'
297         #sub.prop(system, "enable_all_codecs")
298         sub.prop(system, "game_sound")
299         sub.prop(system, "audio_channels", text="Channels")
300         sub.prop(system, "audio_mixing_buffer", text="Mixing Buffer")
301         sub.prop(system, "audio_sample_rate", text="Sample Rate")
302         sub.prop(system, "audio_sample_format", text="Sample Format")
303
304         col.separator()
305         col.separator()
306         col.separator()
307
308         col.label(text="Weight Colors:")
309         col.prop(system, "use_weight_color_range", text="Use Custom Range")
310         sub = col.column()
311         sub.active = system.use_weight_color_range
312         sub.template_color_ramp(system, "weight_color_range", expand=True)
313
314         #column = split.column()
315         #colsplit = column.split(percentage=0.85)
316
317         # No translation in 2.5 yet
318         #col.prop(system, "language")
319         #col.label(text="Translate:")
320         #col.prop(system, "translate_tooltips", text="Tooltips")
321         #col.prop(system, "translate_buttons", text="Labels")
322         #col.prop(system, "translate_toolbox", text="Toolbox")
323
324         #col.separator()
325
326         #col.prop(system, "use_textured_fonts")
327
328         column = split.column()
329         colsplit = column.split(percentage=0.85)
330
331         col1 = colsplit.column()
332         col1.label(text="Solid OpenGL lights:")
333
334         col = col1.split()
335
336         sub = col.column()
337         sub.prop(lamp0, "enabled")
338         subsub = sub.column()
339         subsub.active = lamp0.enabled
340         subsub.prop(lamp0, "diffuse_color")
341         subsub.prop(lamp0, "specular_color")
342         subsub.prop(lamp0, "direction")
343
344         sub = col.column()
345         sub.prop(lamp1, "enabled")
346         subsub = sub.column()
347         subsub.active = lamp1.enabled
348         subsub.prop(lamp1, "diffuse_color")
349         subsub.prop(lamp1, "specular_color")
350         subsub.prop(lamp1, "direction")
351
352         sub = col.column()
353         sub.prop(lamp2, "enabled")
354         subsub = sub.column()
355         subsub.active = lamp2.enabled
356         subsub.prop(lamp2, "diffuse_color")
357         subsub.prop(lamp2, "specular_color")
358         subsub.prop(lamp2, "direction")
359
360         column = split.column()
361         colsplit = column.split(percentage=0.85)
362
363         col = colsplit.column()
364         col.label(text="OpenGL:")
365         col.prop(system, "clip_alpha", slider=True)
366         col.prop(system, "use_mipmaps")
367         col.prop(system, "use_vbos")
368         col.label(text="Window Draw Method:")
369         col.row().prop(system, "window_draw_method", expand=True)
370         col.label(text="Textures:")
371         col.prop(system, "gl_texture_limit", text="Limit Size")
372         col.prop(system, "texture_time_out", text="Time Out")
373         col.prop(system, "texture_collection_rate", text="Collection Rate")
374
375         col.separator()
376         col.separator()
377         col.separator()
378
379         col.label(text="Sequencer:")
380         col.prop(system, "prefetch_frames")
381         col.prop(system, "memory_cache_limit")
382
383
384 class USERPREF_PT_theme(bpy.types.Panel):
385     bl_space_type = 'USER_PREFERENCES'
386     bl_label = "Themes"
387     bl_region_type = 'WINDOW'
388     bl_show_header = False
389
390     def poll(self, context):
391         userpref = context.user_preferences
392         return (userpref.active_section == 'THEMES')
393
394     def draw(self, context):
395         layout = self.layout
396
397         theme = context.user_preferences.themes[0]
398
399         split = layout.split(percentage=0.33)
400         split.prop(theme, "active_theme", text="")
401
402         layout.separator()
403
404         split = layout.split()
405
406         if theme.active_theme == 'VIEW_3D':
407             v3d = theme.view_3d
408
409             col = split.column()
410             col.prop(v3d, "back")
411             col.prop(v3d, "button")
412             col.prop(v3d, "button_title")
413             col.prop(v3d, "button_text")
414             col.prop(v3d, "header")
415
416             col = split.column()
417             col.prop(v3d, "grid")
418             col.prop(v3d, "wire")
419             col.prop(v3d, "lamp", slider=True)
420             col.prop(v3d, "editmesh_active", slider=True)
421
422             col = split.column()
423             col.prop(v3d, "object_selected")
424             col.prop(v3d, "object_active")
425             col.prop(v3d, "object_grouped")
426             col.prop(v3d, "object_grouped_active")
427             col.prop(v3d, "transform")
428
429             col = split.column()
430             col.prop(v3d, "vertex")
431             col.prop(v3d, "face", slider=True)
432             col.prop(v3d, "normal")
433             col.prop(v3d, "bone_solid")
434             col.prop(v3d, "bone_pose")
435             #col.prop(v3d, "edge") Doesn't seem to work
436
437         elif theme.active_theme == 'USER_INTERFACE':
438             ui = theme.user_interface.wcol_regular
439             layout.label(text="Regular:")
440
441             row = layout.row()
442             sub = row.column()
443             sub.prop(ui, "outline")
444             sub.prop(ui, "item", slider=True)
445             sub = row.column()
446             sub.prop(ui, "inner", slider=True)
447             sub.prop(ui, "inner_sel", slider=True)
448             sub = row.column()
449             sub.prop(ui, "text")
450             sub.prop(ui, "text_sel")
451             sub = row.column()
452             sub.prop(ui, "shaded")
453             subsub = sub.column(align=True)
454             subsub.active = ui.shaded
455             subsub.prop(ui, "shadetop")
456             subsub.prop(ui, "shadedown")
457
458             layout.separator()
459
460             ui = theme.user_interface.wcol_tool
461             layout.label(text="Tool:")
462
463             row = layout.row()
464             sub = row.column()
465             sub.prop(ui, "outline")
466             sub.prop(ui, "item", slider=True)
467             sub = row.column()
468             sub.prop(ui, "inner", slider=True)
469             sub.prop(ui, "inner_sel", slider=True)
470             sub = row.column()
471             sub.prop(ui, "text")
472             sub.prop(ui, "text_sel")
473             sub = row.column()
474             sub.prop(ui, "shaded")
475             subsub = sub.column(align=True)
476             subsub.active = ui.shaded
477             subsub.prop(ui, "shadetop")
478             subsub.prop(ui, "shadedown")
479
480             ui = theme.user_interface.wcol_radio
481             layout.label(text="Radio Buttons:")
482
483             row = layout.row()
484             sub = row.column()
485             sub.prop(ui, "outline")
486             sub.prop(ui, "item", slider=True)
487             sub = row.column()
488             sub.prop(ui, "inner", slider=True)
489             sub.prop(ui, "inner_sel", slider=True)
490             sub = row.column()
491             sub.prop(ui, "text")
492             sub.prop(ui, "text_sel")
493             sub = row.column()
494             sub.prop(ui, "shaded")
495             subsub = sub.column(align=True)
496             subsub.active = ui.shaded
497             subsub.prop(ui, "shadetop")
498             subsub.prop(ui, "shadedown")
499
500             ui = theme.user_interface.wcol_text
501             layout.label(text="Text:")
502
503             row = layout.row()
504             sub = row.column()
505             sub.prop(ui, "outline")
506             sub.prop(ui, "item", slider=True)
507             sub = row.column()
508             sub.prop(ui, "inner", slider=True)
509             sub.prop(ui, "inner_sel", slider=True)
510             sub = row.column()
511             sub.prop(ui, "text")
512             sub.prop(ui, "text_sel")
513             sub = row.column()
514             sub.prop(ui, "shaded")
515             subsub = sub.column(align=True)
516             subsub.active = ui.shaded
517             subsub.prop(ui, "shadetop")
518             subsub.prop(ui, "shadedown")
519
520             ui = theme.user_interface.wcol_option
521             layout.label(text="Option:")
522
523             row = layout.row()
524             sub = row.column()
525             sub.prop(ui, "outline")
526             sub.prop(ui, "item", slider=True)
527             sub = row.column()
528             sub.prop(ui, "inner", slider=True)
529             sub.prop(ui, "inner_sel", slider=True)
530             sub = row.column()
531             sub.prop(ui, "text")
532             sub.prop(ui, "text_sel")
533             sub = row.column()
534             sub.prop(ui, "shaded")
535             subsub = sub.column(align=True)
536             subsub.active = ui.shaded
537             subsub.prop(ui, "shadetop")
538             subsub.prop(ui, "shadedown")
539
540             ui = theme.user_interface.wcol_toggle
541             layout.label(text="Toggle:")
542
543             row = layout.row()
544             sub = row.column()
545             sub.prop(ui, "outline")
546             sub.prop(ui, "item", slider=True)
547             sub = row.column()
548             sub.prop(ui, "inner", slider=True)
549             sub.prop(ui, "inner_sel", slider=True)
550             sub = row.column()
551             sub.prop(ui, "text")
552             sub.prop(ui, "text_sel")
553             sub = row.column()
554             sub.prop(ui, "shaded")
555             subsub = sub.column(align=True)
556             subsub.active = ui.shaded
557             subsub.prop(ui, "shadetop")
558             subsub.prop(ui, "shadedown")
559
560             ui = theme.user_interface.wcol_num
561             layout.label(text="Number Field:")
562
563             row = layout.row()
564             sub = row.column()
565             sub.prop(ui, "outline")
566             sub.prop(ui, "item", slider=True)
567             sub = row.column()
568             sub.prop(ui, "inner", slider=True)
569             sub.prop(ui, "inner_sel", slider=True)
570             sub = row.column()
571             sub.prop(ui, "text")
572             sub.prop(ui, "text_sel")
573             sub = row.column()
574             sub.prop(ui, "shaded")
575             subsub = sub.column(align=True)
576             subsub.active = ui.shaded
577             subsub.prop(ui, "shadetop")
578             subsub.prop(ui, "shadedown")
579
580             ui = theme.user_interface.wcol_numslider
581             layout.label(text="Value Slider:")
582
583             row = layout.row()
584             sub = row.column()
585             sub.prop(ui, "outline")
586             sub.prop(ui, "item", slider=True)
587             sub = row.column()
588             sub.prop(ui, "inner", slider=True)
589             sub.prop(ui, "inner_sel", slider=True)
590             sub = row.column()
591             sub.prop(ui, "text")
592             sub.prop(ui, "text_sel")
593             sub = row.column()
594             sub.prop(ui, "shaded")
595             subsub = sub.column(align=True)
596             subsub.active = ui.shaded
597             subsub.prop(ui, "shadetop")
598             subsub.prop(ui, "shadedown")
599
600             ui = theme.user_interface.wcol_box
601             layout.label(text="Box:")
602
603             row = layout.row()
604             sub = row.column()
605             sub.prop(ui, "outline")
606             sub.prop(ui, "item", slider=True)
607             sub = row.column()
608             sub.prop(ui, "inner", slider=True)
609             sub.prop(ui, "inner_sel", slider=True)
610             sub = row.column()
611             sub.prop(ui, "text")
612             sub.prop(ui, "text_sel")
613             sub = row.column()
614             sub.prop(ui, "shaded")
615             subsub = sub.column(align=True)
616             subsub.active = ui.shaded
617             subsub.prop(ui, "shadetop")
618             subsub.prop(ui, "shadedown")
619
620             ui = theme.user_interface.wcol_menu
621             layout.label(text="Menu:")
622
623             row = layout.row()
624             sub = row.column()
625             sub.prop(ui, "outline")
626             sub.prop(ui, "item", slider=True)
627             sub = row.column()
628             sub.prop(ui, "inner", slider=True)
629             sub.prop(ui, "inner_sel", slider=True)
630             sub = row.column()
631             sub.prop(ui, "text")
632             sub.prop(ui, "text_sel")
633             sub = row.column()
634             sub.prop(ui, "shaded")
635             subsub = sub.column(align=True)
636             subsub.active = ui.shaded
637             subsub.prop(ui, "shadetop")
638             subsub.prop(ui, "shadedown")
639
640             ui = theme.user_interface.wcol_pulldown
641             layout.label(text="Pulldown:")
642
643             row = layout.row()
644             sub = row.column()
645             sub.prop(ui, "outline")
646             sub.prop(ui, "item", slider=True)
647             sub = row.column()
648             sub.prop(ui, "inner", slider=True)
649             sub.prop(ui, "inner_sel", slider=True)
650             sub = row.column()
651             sub.prop(ui, "text")
652             sub.prop(ui, "text_sel")
653             sub = row.column()
654             sub.prop(ui, "shaded")
655             subsub = sub.column(align=True)
656             subsub.active = ui.shaded
657             subsub.prop(ui, "shadetop")
658             subsub.prop(ui, "shadedown")
659
660             ui = theme.user_interface.wcol_menu_back
661             layout.label(text="Menu Back:")
662
663             row = layout.row()
664             sub = row.column()
665             sub.prop(ui, "outline")
666             sub.prop(ui, "item", slider=True)
667             sub = row.column()
668             sub.prop(ui, "inner", slider=True)
669             sub.prop(ui, "inner_sel", slider=True)
670             sub = row.column()
671             sub.prop(ui, "text")
672             sub.prop(ui, "text_sel")
673             sub = row.column()
674             sub.prop(ui, "shaded")
675             subsub = sub.column(align=True)
676             subsub.active = ui.shaded
677             subsub.prop(ui, "shadetop")
678             subsub.prop(ui, "shadedown")
679
680             ui = theme.user_interface.wcol_menu_item
681             layout.label(text="Menu Item:")
682
683             row = layout.row()
684             sub = row.column()
685             sub.prop(ui, "outline")
686             sub.prop(ui, "item", slider=True)
687             sub = row.column()
688             sub.prop(ui, "inner", slider=True)
689             sub.prop(ui, "inner_sel", slider=True)
690             sub = row.column()
691             sub.prop(ui, "text")
692             sub.prop(ui, "text_sel")
693             sub = row.column()
694             sub.prop(ui, "shaded")
695             subsub = sub.column(align=True)
696             subsub.active = ui.shaded
697             subsub.prop(ui, "shadetop")
698             subsub.prop(ui, "shadedown")
699
700             ui = theme.user_interface.wcol_scroll
701             layout.label(text="Scroll Bar:")
702
703             row = layout.row()
704             sub = row.column()
705             sub.prop(ui, "outline")
706             sub.prop(ui, "item", slider=True)
707             sub = row.column()
708             sub.prop(ui, "inner", slider=True)
709             sub.prop(ui, "inner_sel", slider=True)
710             sub = row.column()
711             sub.prop(ui, "text")
712             sub.prop(ui, "text_sel")
713             sub = row.column()
714             sub.prop(ui, "shaded")
715             subsub = sub.column(align=True)
716             subsub.active = ui.shaded
717             subsub.prop(ui, "shadetop")
718             subsub.prop(ui, "shadedown")
719
720             ui = theme.user_interface.wcol_list_item
721             layout.label(text="List Item:")
722
723             row = layout.row()
724             sub = row.column()
725             sub.prop(ui, "outline")
726             sub.prop(ui, "item", slider=True)
727             sub = row.column()
728             sub.prop(ui, "inner", slider=True)
729             sub.prop(ui, "inner_sel", slider=True)
730             sub = row.column()
731             sub.prop(ui, "text")
732             sub.prop(ui, "text_sel")
733             sub = row.column()
734             sub.prop(ui, "shaded")
735             subsub = sub.column(align=True)
736             subsub.active = ui.shaded
737             subsub.prop(ui, "shadetop")
738             subsub.prop(ui, "shadedown")
739
740             ui = theme.user_interface.wcol_state
741             layout.label(text="State:")
742
743             row = layout.row()
744             sub = row.column()
745             sub.prop(ui, "inner_anim")
746             sub.prop(ui, "inner_anim_sel")
747             sub = row.column()
748             sub.prop(ui, "inner_driven")
749             sub.prop(ui, "inner_driven_sel")
750             sub = row.column()
751             sub.prop(ui, "inner_key")
752             sub.prop(ui, "inner_key_sel")
753             sub = row.column()
754             sub.prop(ui, "blend")
755
756             ui = theme.user_interface
757             layout.separator()
758
759             sub = layout.row()
760             sub.prop(ui, "icon_file")
761
762             layout.separator()
763             layout.separator()
764
765
766         elif theme.active_theme == 'GRAPH_EDITOR':
767             graph = theme.graph_editor
768
769             col = split.column()
770             col.prop(graph, "back")
771             col.prop(graph, "button")
772             col.prop(graph, "button_title")
773             col.prop(graph, "button_text")
774
775             col = split.column()
776             col.prop(graph, "header")
777             col.prop(graph, "grid")
778             col.prop(graph, "list")
779             col.prop(graph, "channel_group")
780
781             col = split.column()
782             col.prop(graph, "active_channels_group")
783             col.prop(graph, "dopesheet_channel")
784             col.prop(graph, "dopesheet_subchannel")
785             col.prop(graph, "vertex")
786
787             col = split.column()
788             col.prop(graph, "current_frame")
789             col.prop(graph, "handle_vertex")
790             col.prop(graph, "handle_vertex_select")
791             col.separator()
792             col.prop(graph, "handle_vertex_size")
793
794         elif theme.active_theme == 'FILE_BROWSER':
795             file_browse = theme.file_browser
796
797             col = split.column()
798             col.prop(file_browse, "back")
799             col.prop(file_browse, "text")
800             col.prop(file_browse, "text_hi")
801
802             col = split.column()
803             col.prop(file_browse, "header")
804             col.prop(file_browse, "list")
805
806             col = split.column()
807             col.prop(file_browse, "selected_file")
808             col.prop(file_browse, "tiles")
809
810             col = split.column()
811             col.prop(file_browse, "active_file")
812             col.prop(file_browse, "active_file_text")
813
814         elif theme.active_theme == 'NLA_EDITOR':
815             nla = theme.nla_editor
816
817             col = split.column()
818             col.prop(nla, "back")
819             col.prop(nla, "button")
820             col.prop(nla, "button_title")
821
822             col = split.column()
823             col.prop(nla, "button_text")
824             col.prop(nla, "text")
825             col.prop(nla, "header")
826
827             col = split.column()
828             col.prop(nla, "grid")
829             col.prop(nla, "bars")
830             col.prop(nla, "bars_selected")
831
832             col = split.column()
833             col.prop(nla, "strips")
834             col.prop(nla, "strips_selected")
835             col.prop(nla, "current_frame")
836
837         elif theme.active_theme == 'DOPESHEET_EDITOR':
838             dope = theme.dopesheet_editor
839
840             col = split.column()
841             col.prop(dope, "back")
842             col.prop(dope, "list")
843             col.prop(dope, "text")
844             col.prop(dope, "header")
845
846             col = split.column()
847             col.prop(dope, "grid")
848             col.prop(dope, "channels")
849             col.prop(dope, "channels_selected")
850             col.prop(dope, "channel_group")
851
852             col = split.column()
853             col.prop(dope, "active_channels_group")
854             col.prop(dope, "long_key")
855             col.prop(dope, "long_key_selected")
856
857             col = split.column()
858             col.prop(dope, "current_frame")
859             col.prop(dope, "dopesheet_channel")
860             col.prop(dope, "dopesheet_subchannel")
861
862         elif theme.active_theme == 'IMAGE_EDITOR':
863             image = theme.image_editor
864
865             col = split.column()
866             col.prop(image, "back")
867             col.prop(image, "button")
868
869             col = split.column()
870             col.prop(image, "button_title")
871             col.prop(image, "button_text")
872
873             col = split.column()
874             col.prop(image, "header")
875
876             col = split.column()
877             col.prop(image, "editmesh_active", slider=True)
878
879         elif theme.active_theme == 'SEQUENCE_EDITOR':
880             seq = theme.sequence_editor
881
882             col = split.column()
883             col.prop(seq, "back")
884             col.prop(seq, "button")
885             col.prop(seq, "button_title")
886             col.prop(seq, "button_text")
887             col.prop(seq, "text")
888
889             col = split.column()
890             col.prop(seq, "header")
891             col.prop(seq, "grid")
892             col.prop(seq, "movie_strip")
893             col.prop(seq, "image_strip")
894             col.prop(seq, "scene_strip")
895
896             col = split.column()
897             col.prop(seq, "audio_strip")
898             col.prop(seq, "effect_strip")
899             col.prop(seq, "plugin_strip")
900             col.prop(seq, "transition_strip")
901
902             col = split.column()
903             col.prop(seq, "meta_strip")
904             col.prop(seq, "current_frame")
905             col.prop(seq, "keyframe")
906             col.prop(seq, "draw_action")
907
908         elif theme.active_theme == 'PROPERTIES':
909             prop = theme.properties
910
911             col = split.column()
912             col.prop(prop, "back")
913
914             col = split.column()
915             col.prop(prop, "title")
916
917             col = split.column()
918             col.prop(prop, "text")
919
920             col = split.column()
921             col.prop(prop, "header")
922
923         elif theme.active_theme == 'TEXT_EDITOR':
924             text = theme.text_editor
925
926             col = split.column()
927             col.prop(text, "back")
928             col.prop(text, "button")
929             col.prop(text, "button_title")
930             col.prop(text, "button_text")
931
932             col = split.column()
933             col.prop(text, "text")
934             col.prop(text, "text_hi")
935             col.prop(text, "header")
936             col.prop(text, "line_numbers_background")
937
938             col = split.column()
939             col.prop(text, "selected_text")
940             col.prop(text, "cursor")
941             col.prop(text, "syntax_builtin")
942             col.prop(text, "syntax_special")
943
944             col = split.column()
945             col.prop(text, "syntax_comment")
946             col.prop(text, "syntax_string")
947             col.prop(text, "syntax_numbers")
948
949         elif theme.active_theme == 'TIMELINE':
950             time = theme.timeline
951
952             col = split.column()
953             col.prop(time, "back")
954             col.prop(time, "text")
955
956             col = split.column()
957             col.prop(time, "header")
958
959             col = split.column()
960             col.prop(time, "grid")
961
962             col = split.column()
963             col.prop(time, "current_frame")
964
965         elif theme.active_theme == 'NODE_EDITOR':
966             node = theme.node_editor
967
968             col = split.column()
969             col.prop(node, "back")
970             col.prop(node, "button")
971             col.prop(node, "button_title")
972             col.prop(node, "button_text")
973
974             col = split.column()
975             col.prop(node, "text")
976             col.prop(node, "text_hi")
977             col.prop(node, "header")
978             col.prop(node, "wires")
979
980             col = split.column()
981             col.prop(node, "wire_select")
982             col.prop(node, "selected_text")
983             col.prop(node, "node_backdrop", slider=True)
984             col.prop(node, "in_out_node")
985
986             col = split.column()
987             col.prop(node, "converter_node")
988             col.prop(node, "operator_node")
989             col.prop(node, "group_node")
990
991         elif theme.active_theme == 'LOGIC_EDITOR':
992             logic = theme.logic_editor
993
994             col = split.column()
995             col.prop(logic, "back")
996             col.prop(logic, "button")
997
998             col = split.column()
999             col.prop(logic, "button_title")
1000             col.prop(logic, "button_text")
1001
1002             col = split.column()
1003             col.prop(logic, "text")
1004             col.prop(logic, "header")
1005
1006             col = split.column()
1007             col.prop(logic, "panel")
1008
1009         elif theme.active_theme == 'OUTLINER':
1010             out = theme.outliner
1011
1012             col = split.column()
1013             col.prop(out, "back")
1014
1015             col = split.column()
1016             col.prop(out, "text")
1017
1018             col = split.column()
1019             col.prop(out, "text_hi")
1020
1021             col = split.column()
1022             col.prop(out, "header")
1023
1024         elif theme.active_theme == 'INFO':
1025             info = theme.info
1026
1027             col = split.column()
1028             col.prop(info, "back")
1029
1030             col = split.column()
1031             col.prop(info, "header")
1032
1033             col = split.column()
1034             col.prop(info, "header_text")
1035
1036             col = split.column()
1037
1038         elif theme.active_theme == 'USER_PREFERENCES':
1039             prefs = theme.user_preferences
1040
1041             col = split.column()
1042             col.prop(prefs, "back")
1043
1044             col = split.column()
1045             col.prop(prefs, "text")
1046
1047             col = split.column()
1048             col.prop(prefs, "header")
1049
1050             col = split.column()
1051             col.prop(prefs, "header_text")
1052
1053
1054 class USERPREF_PT_file(bpy.types.Panel):
1055     bl_space_type = 'USER_PREFERENCES'
1056     bl_label = "Files"
1057     bl_region_type = 'WINDOW'
1058     bl_show_header = False
1059
1060     def poll(self, context):
1061         userpref = context.user_preferences
1062         return (userpref.active_section == 'FILES')
1063
1064     def draw(self, context):
1065         layout = self.layout
1066
1067         userpref = context.user_preferences
1068         paths = userpref.filepaths
1069
1070         split = layout.split(percentage=0.7)
1071
1072         col = split.column()
1073         col.label(text="File Paths:")
1074
1075         colsplit = col.split(percentage=0.95)
1076         col1 = colsplit.split(percentage=0.3)
1077
1078         sub = col1.column()
1079         sub.label(text="Fonts:")
1080         sub.label(text="Textures:")
1081         sub.label(text="Texture Plugins:")
1082         sub.label(text="Sequence Plugins:")
1083         sub.label(text="Render Output:")
1084         sub.label(text="Scripts:")
1085         sub.label(text="Sounds:")
1086         sub.label(text="Temp:")
1087         sub.label(text="Animation Player:")
1088
1089         sub = col1.column()
1090         sub.prop(paths, "fonts_directory", text="")
1091         sub.prop(paths, "textures_directory", text="")
1092         sub.prop(paths, "texture_plugin_directory", text="")
1093         sub.prop(paths, "sequence_plugin_directory", text="")
1094         sub.prop(paths, "render_output_directory", text="")
1095         sub.prop(paths, "python_scripts_directory", text="")
1096         sub.prop(paths, "sounds_directory", text="")
1097         sub.prop(paths, "temporary_directory", text="")
1098         subsplit = sub.split(percentage=0.3)
1099         subsplit.prop(paths, "animation_player_preset", text="")
1100         subsplit.prop(paths, "animation_player", text="")
1101
1102         col = split.column()
1103         col.label(text="Save & Load:")
1104         col.prop(paths, "use_relative_paths")
1105         col.prop(paths, "compress_file")
1106         col.prop(paths, "load_ui")
1107         col.prop(paths, "filter_file_extensions")
1108         col.prop(paths, "hide_dot_files_datablocks")
1109
1110         col.separator()
1111         col.separator()
1112
1113         col.label(text="Auto Save:")
1114         col.prop(paths, "save_version")
1115         col.prop(paths, "recent_files")
1116         col.prop(paths, "save_preview_images")
1117         col.prop(paths, "auto_save_temporary_files")
1118         sub = col.column()
1119         sub.enabled = paths.auto_save_temporary_files
1120         sub.prop(paths, "auto_save_time", text="Timer (mins)")
1121
1122
1123 class USERPREF_PT_input(bpy.types.Panel):
1124     bl_space_type = 'USER_PREFERENCES'
1125     bl_label = "Input"
1126     bl_region_type = 'WINDOW'
1127     bl_show_header = False
1128
1129     def poll(self, context):
1130         userpref = context.user_preferences
1131         return (userpref.active_section == 'INPUT')
1132
1133     def draw(self, context):
1134         layout = self.layout
1135
1136         userpref = context.user_preferences
1137         wm = context.manager
1138         #input = userpref.input
1139         #input = userpref
1140         inputs = userpref.inputs
1141
1142         split = layout.split(percentage=0.25)
1143
1144         # General settings
1145         row = split.row()
1146         col = row.column()
1147
1148         sub = col.column()
1149         sub.label(text="Configuration:")
1150         sub.prop_object(wm, "active_keyconfig", wm, "keyconfigs", text="")
1151
1152         col.separator()
1153
1154         sub = col.column()
1155         sub.label(text="Mouse:")
1156         sub1 = sub.column()
1157         sub1.enabled = (inputs.select_mouse == 'RIGHT')
1158         sub1.prop(inputs, "emulate_3_button_mouse")
1159         sub.prop(inputs, "continuous_mouse")
1160
1161         sub.label(text="Select With:")
1162         sub.row().prop(inputs, "select_mouse", expand=True)
1163
1164         sub.separator()
1165
1166         sub.prop(inputs, "emulate_numpad")
1167
1168         sub.separator()
1169
1170         sub.label(text="Orbit Style:")
1171         sub.row().prop(inputs, "view_rotation", expand=True)
1172
1173         sub.label(text="Zoom Style:")
1174         sub.row().prop(inputs, "viewport_zoom_style", expand=True)
1175         if inputs.viewport_zoom_style == 'DOLLY':
1176             sub.row().prop(inputs, "zoom_axis", expand=True)
1177             sub.prop(inputs, "invert_zoom_direction")
1178
1179         #sub.prop(inputs, "use_middle_mouse_paste")
1180
1181         #col.separator()
1182
1183         #sub = col.column()
1184         #sub.label(text="Mouse Wheel:")
1185         #sub.prop(view, "wheel_scroll_lines", text="Scroll Lines")
1186
1187         col.separator()
1188
1189         sub = col.column()
1190         sub.label(text="NDOF Device:")
1191         sub.prop(inputs, "ndof_pan_speed", text="Pan Speed")
1192         sub.prop(inputs, "ndof_rotate_speed", text="Orbit Speed")
1193
1194         col.separator()
1195
1196         sub = col.column()
1197         sub.label(text="Double Click:")
1198         sub.prop(inputs, "double_click_time", text="Speed")
1199
1200         row.separator()
1201
1202         # Keymap Settings
1203         col = split.column()
1204
1205         # kc = wm.active_keyconfig
1206         defkc = wm.default_keyconfig
1207         km = wm.active_keymap
1208
1209         subsplit = col.split()
1210         subsplit.prop_object(wm, "active_keymap", defkc, "keymaps", text="Map:")
1211         if km.user_defined:
1212             row = subsplit.row()
1213             row.operator("WM_OT_keymap_restore", text="Restore")
1214             row.operator("WM_OT_keymap_restore", text="Restore All").all = True
1215         else:
1216             row = subsplit.row()
1217             row.operator("WM_OT_keymap_edit", text="Edit")
1218             row.label()
1219
1220         col.separator()
1221
1222         for kmi in km.items:
1223             subcol = col.column()
1224             subcol.set_context_pointer("keyitem", kmi)
1225
1226             row = subcol.row()
1227
1228             if kmi.expanded:
1229                 row.prop(kmi, "expanded", text="", icon='TRIA_DOWN')
1230             else:
1231                 row.prop(kmi, "expanded", text="", icon='TRIA_RIGHT')
1232
1233             itemrow = row.row()
1234             itemrow.enabled = km.user_defined
1235             if kmi.active:
1236                 itemrow.prop(kmi, "active", text="", icon='CHECKBOX_HLT')
1237             else:
1238                 itemrow.prop(kmi, "active", text="", icon='CHECKBOX_DEHLT')
1239
1240             itemcol = itemrow.column()
1241             itemcol.active = kmi.active
1242             row = itemcol.row()
1243
1244             if km.modal:
1245                 row.prop(kmi, "propvalue", text="")
1246             else:
1247                 row.prop(kmi, "idname", text="")
1248
1249             sub = row.row()
1250             sub.scale_x = 0.6
1251             sub.prop(kmi, "map_type", text="")
1252
1253             sub = row.row(align=True)
1254             if kmi.map_type == 'KEYBOARD':
1255                 sub.prop(kmi, "type", text="", full_event=True)
1256             elif kmi.map_type == 'MOUSE':
1257                 sub.prop(kmi, "type", text="", full_event=True)
1258             elif kmi.map_type == 'TWEAK':
1259                 sub.scale_x = 0.5
1260                 sub.prop(kmi, "type", text="")
1261                 sub.prop(kmi, "value", text="")
1262             elif kmi.map_type == 'TIMER':
1263                 sub.prop(kmi, "type", text="")
1264             else:
1265                 sub.label()
1266
1267             if kmi.expanded:
1268                 if kmi.map_type not in ('TEXTINPUT', 'TIMER'):
1269                     sub = itemcol.row(align=True)
1270
1271                     if kmi.map_type == 'KEYBOARD':
1272                         sub.prop(kmi, "type", text="", event=True)
1273                         sub.prop(kmi, "value", text="")
1274                     elif kmi.map_type == 'MOUSE':
1275                         sub.prop(kmi, "type", text="")
1276                         sub.prop(kmi, "value", text="")
1277                     else:
1278                         sub.label()
1279                         sub.label()
1280
1281                     subrow = sub.row()
1282                     subrow.scale_x = 0.75
1283                     subrow.prop(kmi, "any")
1284                     subrow.prop(kmi, "shift")
1285                     subrow.prop(kmi, "ctrl")
1286                     subrow.prop(kmi, "alt")
1287                     subrow.prop(kmi, "oskey", text="Cmd")
1288                     sub.prop(kmi, "key_modifier", text="", event=True)
1289
1290                 flow = itemcol.column_flow(columns=2)
1291                 props = kmi.properties
1292
1293                 if props is not None:
1294                     for pname in dir(props):
1295                         if not props.is_property_hidden(pname):
1296                             flow.prop(props, pname)
1297
1298                 itemcol.separator()
1299
1300             itemrow.operator("wm.keyitem_remove", text="", icon='ZOOMOUT')
1301
1302         itemrow = col.row()
1303         itemrow.label()
1304         itemrow.operator("wm.keyitem_add", text="", icon='ZOOMIN')
1305         itemrow.enabled = km.user_defined
1306
1307 bpy.types.register(USERPREF_HT_header)
1308 bpy.types.register(USERPREF_PT_tabs)
1309 bpy.types.register(USERPREF_PT_interface)
1310 bpy.types.register(USERPREF_PT_theme)
1311 bpy.types.register(USERPREF_PT_edit)
1312 bpy.types.register(USERPREF_PT_system)
1313 bpy.types.register(USERPREF_PT_file)
1314 bpy.types.register(USERPREF_PT_input)
1315
1316 from bpy.props import *
1317
1318
1319 class WM_OT_keyconfig_export(bpy.types.Operator):
1320     "Export key configuration to a python script."
1321     bl_idname = "wm.keyconfig_export"
1322     bl_label = "Export Key Configuration..."
1323
1324     path = bpy.props.StringProperty(name="File Path", description="File path to write file to.")
1325
1326     def _string_value(self, value):
1327         result = ""
1328         if isinstance(value, str):
1329             if value != "":
1330                 result = "\'%s\'" % value
1331         elif isinstance(value, bool):
1332             if value:
1333                 result = "True"
1334             else:
1335                 result = "False"
1336         elif isinstance(value, float):
1337             result = "%.10f" % value
1338         elif isinstance(value, int):
1339             result = "%d" % value
1340         elif getattr(value, '__len__', False):
1341             if len(value):
1342                 result = "["
1343                 for i in range(0, len(value)):
1344                     result += self._string_value(value[i])
1345                     if i != len(value)-1:
1346                         result += ", "
1347                 result += "]"
1348         else:
1349             print("Export key configuration: can't write ", value)
1350
1351         return result
1352
1353     def execute(self, context):
1354         if not self.properties.path:
1355             raise Exception("File path not set.")
1356
1357         f = open(self.properties.path, "w")
1358         if not f:
1359             raise Exception("Could not open file.")
1360
1361         wm = context.manager
1362         kc = wm.active_keyconfig
1363
1364         f.write('# Configuration %s\n' % kc.name)
1365
1366         f.write("wm = bpy.data.windowmanagers[0]\n")
1367         f.write("kc = wm.add_keyconfig(\'%s\')\n\n" % kc.name)
1368
1369         for km in kc.keymaps:
1370             km = km.active()
1371             f.write("# Map %s\n" % km.name)
1372             f.write("km = kc.add_keymap(\'%s\', space_type=\'%s\', region_type=\'%s\', modal=%s)\n\n" % (km.name, km.space_type, km.region_type, km.modal))
1373             for kmi in km.items:
1374                 if km.modal:
1375                     f.write("kmi = km.add_modal_item(\'%s\', \'%s\', \'%s\'" % (kmi.propvalue, kmi.type, kmi.value))
1376                 else:
1377                     f.write("kmi = km.add_item(\'%s\', \'%s\', \'%s\'" % (kmi.idname, kmi.type, kmi.value))
1378                 if kmi.any:
1379                     f.write(", any=True")
1380                 else:
1381                     if kmi.shift:
1382                         f.write(", shift=True")
1383                     if kmi.ctrl:
1384                         f.write(", ctrl=True")
1385                     if kmi.alt:
1386                         f.write(", alt=True")
1387                     if kmi.oskey:
1388                         f.write(", oskey=True")
1389                 if kmi.key_modifier and kmi.key_modifier != 'NONE':
1390                     f.write(", key_modifier=\'%s\'" % kmi.key_modifier)
1391                 f.write(")\n")
1392
1393                 props = kmi.properties
1394
1395                 if props is not None:
1396                     for pname in dir(props):
1397                         if props.is_property_set(pname) and not props.is_property_hidden(pname):
1398                             value = eval("props.%s" % pname)
1399                             value = self._string_value(value)
1400                             if value != "":
1401                                 f.write("kmi.properties.%s = %s\n" % (pname, value))
1402
1403             f.write("\n")
1404
1405         f.close()
1406
1407         return ('FINISHED',)
1408
1409     def invoke(self, context, event):
1410         wm = context.manager
1411         wm.add_fileselect(self)
1412         return ('RUNNING_MODAL',)
1413
1414
1415 class WM_OT_keymap_edit(bpy.types.Operator):
1416     "Edit key map."
1417     bl_idname = "wm.keymap_edit"
1418     bl_label = "Edit Key Map"
1419
1420     def execute(self, context):
1421         wm = context.manager
1422         km = wm.active_keymap
1423         km.copy_to_user()
1424         return ('FINISHED',)
1425
1426
1427 class WM_OT_keymap_restore(bpy.types.Operator):
1428     "Restore key map(s)."
1429     bl_idname = "wm.keymap_restore"
1430     bl_label = "Restore Key Map(s)"
1431
1432     all = BoolProperty(attr="all", name="All Keymaps", description="Restore all keymaps to default.")
1433
1434     def execute(self, context):
1435         wm = context.manager
1436
1437         if self.properties.all:
1438             for km in wm.default_keyconfig.keymaps:
1439                 km.restore_to_default()
1440         else:
1441             km = wm.active_keymap
1442             km.restore_to_default()
1443
1444         return ('FINISHED',)
1445
1446
1447 class WM_OT_keyitem_add(bpy.types.Operator):
1448     "Add key map item."
1449     bl_idname = "wm.keyitem_add"
1450     bl_label = "Add Key Map Item"
1451
1452     def execute(self, context):
1453         wm = context.manager
1454         km = wm.active_keymap
1455         if km.modal:
1456             km.add_modal_item("", 'A', 'PRESS') # kmi
1457         else:
1458             km.add_item("", 'A', 'PRESS') # kmi
1459         return ('FINISHED',)
1460
1461
1462 class WM_OT_keyitem_remove(bpy.types.Operator):
1463     "Remove key map item."
1464     bl_idname = "wm.keyitem_remove"
1465     bl_label = "Remove Key Map Item"
1466
1467     def execute(self, context):
1468         wm = context.manager
1469         kmi = context.keyitem
1470         km = wm.active_keymap
1471         km.remove_item(kmi)
1472         return ('FINISHED',)
1473
1474 bpy.ops.add(WM_OT_keyconfig_export)
1475 bpy.ops.add(WM_OT_keymap_edit)
1476 bpy.ops.add(WM_OT_keymap_restore)
1477 bpy.ops.add(WM_OT_keyitem_add)
1478 bpy.ops.add(WM_OT_keyitem_remove)