4 class INFO_HT_header(bpy.types.Header):
5 __space_type__ = "USER_PREFERENCES"
6 __idname__ = "INFO_HT_header"
8 def draw(self, context):
9 st = context.space_data
10 rd = context.scene.render_data
13 layout.template_header()
15 if context.area.show_menus:
17 row.itemM("INFO_MT_file")
18 row.itemM("INFO_MT_add")
19 if rd.use_game_engine:
20 row.itemM("INFO_MT_game")
22 row.itemM("INFO_MT_render")
23 row.itemM("INFO_MT_help")
25 layout.template_ID(context.window, "screen") #, new="screen.new", open="scene.unlink")
26 layout.template_ID(context.screen, "scene") #, new="screen.new", unlink="scene.unlink")
28 if rd.multiple_engines:
29 layout.itemR(rd, "engine", text="")
33 layout.template_operator_search()
34 layout.template_running_jobs()
36 class INFO_MT_file(bpy.types.Menu):
37 __space_type__ = "USER_PREFERENCES"
40 def draw(self, context):
43 layout.operator_context = "EXEC_AREA"
44 layout.itemO("wm.read_homefile", text="New")
45 layout.operator_context = "INVOKE_AREA"
46 layout.itemO("wm.open_mainfile", text="Open...")
47 layout.item_menu_enumO("wm.open_recentfile", "file", text="Open Recent")
48 layout.itemO("wm.recover_last_session")
52 layout.operator_context = "EXEC_AREA"
53 layout.itemO("wm.save_mainfile", text="Save")
54 layout.operator_context = "INVOKE_AREA"
55 layout.itemO("wm.save_as_mainfile", text="Save As...")
56 layout.itemO("screen.userpref_show", text="User Preferences...")
60 layout.itemM("INFO_MT_file_import")
61 layout.itemM("INFO_MT_file_export")
65 layout.itemM("INFO_MT_file_external_data")
69 layout.operator_context = "EXEC_AREA"
70 layout.itemO("wm.exit_blender", text="Quit")
72 class INFO_MT_file_import(bpy.types.Menu):
73 __space_type__ = "USER_PREFERENCES"
76 def draw(self, context):
79 class INFO_MT_file_export(bpy.types.Menu):
80 __space_type__ = "USER_PREFERENCES"
83 def draw(self, context):
86 layout.itemO("export.ply", text="PLY")
88 class INFO_MT_file_external_data(bpy.types.Menu):
89 __space_type__ = "USER_PREFERENCES"
90 __label__ = "External Data"
92 def draw(self, context):
95 layout.itemO("file.pack_all", text="Pack into .blend file")
96 layout.itemO("file.unpack_all", text="Unpack into Files...")
100 layout.itemO("file.make_paths_relative")
101 layout.itemO("file.make_paths_absolute")
102 layout.itemO("file.report_missing_files")
103 layout.itemO("file.find_missing_files")
105 class INFO_MT_add(bpy.types.Menu):
106 __space_type__ = "USER_PREFERENCES"
109 def draw(self, context):
112 layout.operator_context = "EXEC_SCREEN"
114 layout.item_menu_enumO( "OBJECT_OT_mesh_add", "type", text="Mesh", icon="ICON_OUTLINER_OB_MESH")
115 layout.item_menu_enumO( "OBJECT_OT_curve_add", "type", text="Curve", icon="ICON_OUTLINER_OB_CURVE")
116 layout.item_menu_enumO( "OBJECT_OT_surface_add", "type", text="Surface", icon="ICON_OUTLINER_OB_SURFACE")
117 layout.item_enumO("OBJECT_OT_object_add", "type", "META", icon="ICON_OUTLINER_OB_META")
118 layout.itemO("OBJECT_OT_text_add", text="Text", icon="ICON_OUTLINER_OB_FONT")
122 layout.itemO("OBJECT_OT_armature_add", text="Armature", icon="ICON_OUTLINER_OB_ARMATURE")
123 layout.item_enumO("OBJECT_OT_object_add", "type", "LATTICE", icon="ICON_OUTLINER_OB_LATTICE")
124 layout.item_enumO("OBJECT_OT_object_add", "type", "EMPTY", icon="ICON_OUTLINER_OB_EMPTY")
128 layout.item_enumO("OBJECT_OT_object_add", "type", "CAMERA", icon="ICON_OUTLINER_OB_CAMERA")
129 layout.item_enumO("OBJECT_OT_object_add", "type", "LAMP", icon="ICON_OUTLINER_OB_LAMP")
131 class INFO_MT_game(bpy.types.Menu):
132 __space_type__ = "USER_PREFERENCES"
135 def draw(self, context):
138 layout.itemO("view3d.game_start")
140 class INFO_MT_render(bpy.types.Menu):
141 __space_type__ = "USER_PREFERENCES"
144 def draw(self, context):
146 rd = context.scene.render_data
148 layout.itemO("screen.render", text="Render Image")
149 layout.item_booleanO("screen.render", "animation", True, text="Render Animation")
153 layout.itemO("screen.render_view_show")
155 class INFO_MT_help(bpy.types.Menu):
156 __space_type__ = "USER_PREFERENCES"
159 def draw(self, context):
162 layout.itemO("help.manual")
163 layout.itemO("help.release_logs")
167 layout.itemO("help.blender_website")
168 layout.itemO("help.blender_eshop")
169 layout.itemO("help.developer_community")
170 layout.itemO("help.user_community")
172 class INFO_PT_tabs(bpy.types.Panel):
173 __space_type__ = "USER_PREFERENCES"
176 def draw(self, context):
178 userpref = context.user_preferences
180 layout.itemR(userpref, "active_section", expand=True)
182 class INFO_PT_view(bpy.types.Panel):
183 __space_type__ = "USER_PREFERENCES"
187 def poll(self, context):
188 userpref = context.user_preferences
189 return (userpref.active_section == 'VIEW_CONTROLS')
191 def draw(self, context):
193 userpref = context.user_preferences
196 split = layout.split()
198 colsplit = col.split(percentage=0.85)
199 colsplitcol = colsplit.column()
200 colsplitcol.itemL(text="Display:")
201 colsplitcol.itemR(view, "tooltips")
202 colsplitcol.itemR(view, "display_object_info", text="Object Info")
203 colsplitcol.itemR(view, "use_large_cursors")
204 colsplitcol.itemR(view, "show_view_name", text="View Name")
205 colsplitcol.itemR(view, "show_playback_fps", text="Playback FPS")
206 colsplitcol.itemR(view, "global_scene")
207 colsplitcol.itemR(view, "pin_floating_panels")
208 colsplitcol.itemR(view, "object_center_size")
213 colsplitcol.itemR(view, "show_mini_axis")
214 colsub = colsplitcol.column()
215 colsub.enabled = view.show_mini_axis
216 colsub.itemR(view, "mini_axis_size")
217 colsub.itemR(view, "mini_axis_brightness")
223 colsplit = col.split(percentage=0.85)
224 colsplitcol = colsplit.column()
225 colsplitcol.itemL(text="View Manipulation:")
226 colsplitcol.itemR(view, "auto_depth")
227 colsplitcol.itemR(view, "global_pivot")
228 colsplitcol.itemR(view, "zoom_to_mouse")
229 colsplitcol.itemR(view, "rotate_around_selection")
230 colsplitcol.itemL(text="Zoom Style:")
231 row = colsplitcol.row()
232 row.itemR(view, "viewport_zoom_style", expand=True)
233 colsplitcol.itemL(text="Orbit Style:")
234 row = colsplitcol.row()
235 row.itemR(view, "view_rotation", expand=True)
236 colsplitcol.itemR(view, "perspective_orthographic_switch")
237 colsplitcol.itemR(view, "smooth_view")
238 colsplitcol.itemR(view, "rotation_angle")
239 colsplitcol.itemL(text="NDOF Device:")
240 colsplitcol.itemR(view, "ndof_pan_speed", text="Pan Speed")
241 colsplitcol.itemR(view, "ndof_rotate_speed", text="Orbit Speed")
244 colsplit = col.split(percentage=0.85)
245 colsplitcol = colsplit.column()
246 colsplitcol.itemL(text="Mouse Buttons:")
247 colsplitcol.itemR(view, "left_mouse_button_select")
248 colsplitcol.itemR(view, "right_mouse_button_select")
249 colsplitcol.itemR(view, "emulate_3_button_mouse")
250 colsplitcol.itemR(view, "use_middle_mouse_paste")
251 colsplitcol.itemR(view, "middle_mouse_rotate")
252 colsplitcol.itemR(view, "middle_mouse_pan")
253 colsplitcol.itemR(view, "wheel_invert_zoom")
254 colsplitcol.itemR(view, "wheel_scroll_lines")
259 colsplitcol.itemL(text="Menus:")
260 colsplitcol.itemR(view, "open_mouse_over")
261 colsplitcol.itemL(text="Menu Open Delay:")
262 colsplitcol.itemR(view, "open_toplevel_delay", text="Top Level")
263 colsplitcol.itemR(view, "open_sublevel_delay", text="Sub Level")
267 colsplit = col.split(percentage=0.85)
268 colsplitcol = colsplit.column()
270 colsplitcol.itemR(view, "use_manipulator")
271 colsub = colsplitcol.column()
272 colsub.enabled = view.use_manipulator
273 colsub.itemR(view, "manipulator_size", text="Size")
274 colsub.itemR(view, "manipulator_handle_size", text="Handle Size")
275 colsub.itemR(view, "manipulator_hotspot", text="Hotspot")
280 colsplitcol.itemL(text="Toolbox:")
281 colsplitcol.itemR(view, "use_column_layout")
282 colsplitcol.itemL(text="Open Toolbox Delay:")
283 colsplitcol.itemR(view, "open_left_mouse_delay", text="Hold LMB")
284 colsplitcol.itemR(view, "open_right_mouse_delay", text="Hold RMB")
287 class INFO_PT_edit(bpy.types.Panel):
288 __space_type__ = "USER_PREFERENCES"
292 def poll(self, context):
293 userpref = context.user_preferences
294 return (userpref.active_section == 'EDIT_METHODS')
296 def draw(self, context):
298 userpref = context.user_preferences
302 split = layout.split()
304 colsplit = col.split(percentage=0.85)
305 colsplitcol = colsplit.column()
307 colsplitcol.itemL(text="Materials:")
308 colsplitcol.itemR(edit, "material_linked_object", text="Linked to Object")
309 colsplitcol.itemR(edit, "material_linked_obdata", text="Linked to ObData")
314 colsplitcol.itemL(text="New Objects:")
315 colsplitcol.itemR(edit, "enter_edit_mode")
316 colsplitcol.itemR(edit, "align_to_view")
321 colsplitcol.itemL(text="Transform:")
322 colsplitcol.itemR(edit, "drag_immediately")
325 colsplit = col.split(percentage=0.85)
326 colsplitcol = colsplit.column()
327 colsplitcol.itemL(text="Snap:")
328 colsplitcol.itemR(edit, "snap_translate", text="Translate")
329 colsplitcol.itemR(edit, "snap_rotate", text="Rotate")
330 colsplitcol.itemR(edit, "snap_scale", text="Scale")
335 colsplitcol.itemL(text="Grease Pencil:")
336 colsplitcol.itemR(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
337 colsplitcol.itemR(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
338 colsplitcol.itemR(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
339 colsplitcol.itemR(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
340 colsplitcol.itemR(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
344 colsplit = col.split(percentage=0.85)
345 colsplitcol = colsplit.column()
347 colsplitcol.itemL(text="Keyframing:")
348 colsplitcol.itemR(edit, "use_visual_keying")
349 colsplitcol.itemR(edit, "new_interpolation_type")
350 colsplitcol.itemR(edit, "auto_keying_enable", text="Auto Keyframing")
351 colsub = colsplitcol.column()
352 colsub.enabled = edit.auto_keying_enable
354 row.itemR(edit, "auto_keying_mode", expand=True)
355 colsub.itemR(edit, "auto_keyframe_insert_available", text="Only Insert Available")
356 colsub.itemR(edit, "auto_keyframe_insert_needed", text="Only Insert Needed")
361 colsplitcol.itemL(text="Undo:")
362 colsplitcol.itemR(edit, "global_undo")
363 colsplitcol.itemR(edit, "undo_steps", text="Steps")
364 colsplitcol.itemR(edit, "undo_memory_limit", text="Memory Limit")
370 colsplit = col.split(percentage=0.85)
371 colsplitcol = colsplit.column()
372 colsplitcol.itemL(text="Duplicate:")
373 colsplitcol.itemR(edit, "duplicate_mesh", text="Mesh")
374 colsplitcol.itemR(edit, "duplicate_surface", text="Surface")
375 colsplitcol.itemR(edit, "duplicate_curve", text="Curve")
376 colsplitcol.itemR(edit, "duplicate_text", text="Text")
377 colsplitcol.itemR(edit, "duplicate_metaball", text="Metaball")
378 colsplitcol.itemR(edit, "duplicate_armature", text="Armature")
379 colsplitcol.itemR(edit, "duplicate_lamp", text="Lamp")
380 colsplitcol.itemR(edit, "duplicate_material", text="Material")
381 colsplitcol.itemR(edit, "duplicate_texture", text="Texture")
382 colsplitcol.itemR(edit, "duplicate_ipo", text="F-Curve")
383 colsplitcol.itemR(edit, "duplicate_action", text="Action")
385 class INFO_PT_system(bpy.types.Panel):
386 __space_type__ = "USER_PREFERENCES"
390 def poll(self, context):
391 userpref = context.user_preferences
392 return (userpref.active_section == 'SYSTEM_OPENGL')
394 def draw(self, context):
396 userpref = context.user_preferences
397 system = userpref.system
398 lan = userpref.language
400 split = layout.split()
402 colsplit = col.split(percentage=0.85)
403 colsplitcol = colsplit.column()
404 colsplitcol.itemR(system, "emulate_numpad")
408 colsplitcol.itemL(text="Weight Colors:")
409 colsplitcol.itemR(system, "use_weight_color_range", text="Use Custom Range")
411 colsub = colsplitcol.column()
412 colsub.active = system.use_weight_color_range
413 colsub.template_color_ramp(system.weight_color_range, expand=True)
418 colsplitcol.itemL(text="Sequencer:")
419 colsplitcol.itemR(system, "prefetch_frames")
420 colsplitcol.itemR(system, "memory_cache_limit")
423 colsplit = col.split(percentage=0.85)
424 colsplitcol = colsplit.column()
426 colsplitcol.itemL(text="System:")
427 colsplitcol.itemR(lan, "dpi")
428 colsplitcol.itemR(system, "enable_all_codecs")
429 colsplitcol.itemR(system, "auto_run_python_scripts")
430 colsplitcol.itemR(system, "frame_server_port")
431 colsplitcol.itemR(system, "game_sound")
432 colsplitcol.itemR(system, "filter_file_extensions")
433 colsplitcol.itemR(system, "hide_dot_files_datablocks")
434 colsplitcol.itemR(system, "audio_mixing_buffer")
437 colsplit = col.split(percentage=0.85)
438 colsplitcol = colsplit.column()
440 colsplitcol.itemL(text="OpenGL:")
441 colsplitcol.itemR(system, "clip_alpha", slider=True)
442 colsplitcol.itemR(system, "use_mipmaps")
443 colsplitcol.itemL(text="Window Draw Method:")
444 row = colsplitcol.row()
445 row.itemR(system, "window_draw_method", expand=True)
446 colsplitcol.itemL(text="Textures:")
447 colsplitcol.itemR(system, "gl_texture_limit", text="Limit Size")
448 colsplitcol.itemR(system, "texture_time_out", text="Time Out")
449 colsplitcol.itemR(system, "texture_collection_rate", text="Collection Rate")
451 class INFO_PT_filepaths(bpy.types.Panel):
452 __space_type__ = "USER_PREFERENCES"
453 __label__ = "File Paths"
456 def poll(self, context):
457 userpref = context.user_preferences
458 return (userpref.active_section == 'FILE_PATHS')
460 def draw(self, context):
462 userpref = context.user_preferences
463 paths = userpref.filepaths
465 split = layout.split()
467 col.itemL(text="File Paths:")
468 splitcol = col.split(percentage=0.3)
470 splitcol.itemL(text="Fonts:")
471 splitcol.itemR(paths, "fonts_directory", text="")
472 splitcol = col.split(percentage=0.3)
473 splitcol.itemL(text="Textures:")
474 splitcol.itemR(paths, "textures_directory", text="")
475 splitcol = col.split(percentage=0.3)
476 splitcol.itemL(text="Texture Plugins:")
477 splitcol.itemR(paths, "texture_plugin_directory", text="")
478 splitcol = col.split(percentage=0.3)
479 splitcol.itemL(text="Sequence Plugins:")
480 splitcol.itemR(paths, "sequence_plugin_directory", text="")
481 splitcol = col.split(percentage=0.3)
482 splitcol.itemL(text="Render Output:")
483 splitcol.itemR(paths, "render_output_directory", text="")
484 splitcol = col.split(percentage=0.3)
485 splitcol.itemL(text="Scripts:")
486 splitcol.itemR(paths, "python_scripts_directory", text="")
487 splitcol = col.split(percentage=0.3)
488 splitcol.itemL(text="Sounds:")
489 splitcol.itemR(paths, "sounds_directory", text="")
490 splitcol = col.split(percentage=0.3)
491 splitcol.itemL(text="Temp:")
492 splitcol.itemR(paths, "temporary_directory", text="")
495 colsplit = col.split(percentage=0.2)
496 colsplitcol = colsplit.column()
497 colsplitcol = colsplit.column()
498 colsplitcol.itemL(text="Save & Load:")
499 colsplitcol.itemR(paths, "use_relative_paths")
500 colsplitcol.itemR(paths, "compress_file")
501 colsplitcol.itemL(text="Auto Save:")
502 colsplitcol.itemR(paths, "save_version")
503 colsplitcol.itemR(paths, "recent_files")
504 colsplitcol.itemR(paths, "save_preview_images")
505 colsplitcol.itemR(paths, "auto_save_temporary_files")
506 colsub = colsplitcol.column()
507 colsub.enabled = paths.auto_save_temporary_files
508 colsub.itemR(paths, "auto_save_time")
510 class INFO_PT_language(bpy.types.Panel):
511 __space_type__ = "USER_PREFERENCES"
512 __label__ = "Language"
515 def poll(self, context):
516 userpref = context.user_preferences
517 return (userpref.active_section == 'LANGUAGE_COLORS')
519 def draw(self, context):
521 userpref = context.user_preferences
522 lan = userpref.language
524 split = layout.split()
527 col.itemR(lan, "language")
528 col.itemR(lan, "translate_tooltips")
529 col.itemR(lan, "translate_buttons")
530 col.itemR(lan, "translate_toolbox")
531 col.itemR(lan, "use_textured_fonts")
533 class INFO_PT_bottombar(bpy.types.Panel):
534 __space_type__ = "USER_PREFERENCES"
538 def draw(self, context):
540 userpref = context.user_preferences
542 split = layout.split(percentage=0.8)
544 layout.operator_context = "EXEC_AREA"
545 split.itemO("wm.save_homefile", text="Save As Default")
547 bpy.types.register(INFO_HT_header)
548 bpy.types.register(INFO_MT_file)
549 bpy.types.register(INFO_MT_file_import)
550 bpy.types.register(INFO_MT_file_export)
551 bpy.types.register(INFO_MT_file_external_data)
552 bpy.types.register(INFO_MT_add)
553 bpy.types.register(INFO_MT_game)
554 bpy.types.register(INFO_MT_render)
555 bpy.types.register(INFO_MT_help)
556 bpy.types.register(INFO_PT_tabs)
557 bpy.types.register(INFO_PT_view)
558 bpy.types.register(INFO_PT_edit)
559 bpy.types.register(INFO_PT_system)
560 bpy.types.register(INFO_PT_filepaths)
561 bpy.types.register(INFO_PT_language)
562 bpy.types.register(INFO_PT_bottombar)
566 import bpy_ops # XXX - should not need to do this
569 class HelpOperator(bpy.types.Operator):
570 def execute(self, context):
571 try: import webbrowser
572 except: webbrowser = None
575 webbrowser.open(self.__URL__)
577 raise Exception("Operator requires a full Python installation")
581 class HELP_OT_manual(HelpOperator):
582 __idname__ = "help.manual"
584 __URL__ = 'http://wiki.blender.org/index.php/Manual'
586 class HELP_OT_release_logs(HelpOperator):
587 __idname__ = "help.release_logs"
588 __label__ = "Release Logs"
589 __URL__ = 'http://www.blender.org/development/release-logs/'
591 class HELP_OT_blender_website(HelpOperator):
592 __idname__ = "help.blender_website"
593 __label__ = "Blender Website"
594 __URL__ = 'http://www.blender.org/'
596 class HELP_OT_blender_eshop(HelpOperator):
597 __idname__ = "help.blender_eshop"
598 __label__ = "Blender e-Shop"
599 __URL__ = 'http://www.blender3d.org/e-shop'
601 class HELP_OT_developer_community(HelpOperator):
602 __idname__ = "help.developer_community"
603 __label__ = "Developer Community"
604 __URL__ = 'http://www.blender.org/community/get-involved/'
606 class HELP_OT_user_community(HelpOperator):
607 __idname__ = "help.user_community"
608 __label__ = "User Community"
609 __URL__ = 'http://www.blender.org/community/user-community/'
611 bpy.ops.add(HELP_OT_manual)
612 bpy.ops.add(HELP_OT_release_logs)
613 bpy.ops.add(HELP_OT_blender_website)
614 bpy.ops.add(HELP_OT_blender_eshop)
615 bpy.ops.add(HELP_OT_developer_community)
616 bpy.ops.add(HELP_OT_user_community)