2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-06-30 19:20:45 +00:00
|
|
|
import bpy
|
2011-09-22 19:50:41 +00:00
|
|
|
from bpy.types import Header, Menu
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_HT_header(Header):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'INFO'
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2010-03-06 01:40:29 +00:00
|
|
|
|
2009-12-08 07:12:06 +00:00
|
|
|
window = context.window
|
2009-10-31 19:31:45 +00:00
|
|
|
scene = context.scene
|
2010-02-23 12:48:35 +00:00
|
|
|
rd = scene.render
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.template_header()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if context.area.show_menus:
|
|
|
|
sub = row.row(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("INFO_MT_file")
|
2009-10-31 19:31:45 +00:00
|
|
|
if rd.use_game_engine:
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("INFO_MT_game")
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("INFO_MT_render")
|
2012-04-30 19:37:04 +00:00
|
|
|
sub.menu("INFO_MT_window")
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("INFO_MT_help")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
if window.screen.show_fullscreen:
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text="Back to Previous")
|
2009-12-08 07:12:06 +00:00
|
|
|
layout.separator()
|
|
|
|
else:
|
|
|
|
layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
|
2011-02-01 13:35:21 +00:00
|
|
|
layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete")
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-11-01 18:05:01 +00:00
|
|
|
|
2010-08-18 04:10:23 +00:00
|
|
|
if rd.has_multiple_engines:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(rd, "engine", text="")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-08-19 12:35:40 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.template_running_jobs()
|
2010-03-06 01:40:29 +00:00
|
|
|
|
2010-06-03 07:27:55 +00:00
|
|
|
layout.template_reports_banner()
|
2011-07-29 01:24:03 +00:00
|
|
|
|
2011-07-23 15:36:51 +00:00
|
|
|
row = layout.row(align=True)
|
2013-06-10 00:42:16 +00:00
|
|
|
|
|
|
|
if bpy.app.autoexec_fail is True and bpy.app.autoexec_fail_quiet is False:
|
|
|
|
layout.operator_context = 'EXEC_DEFAULT'
|
2013-06-12 00:10:56 +00:00
|
|
|
row.label("Auto-run disabled: %s" % bpy.app.autoexec_fail_message, icon='ERROR')
|
2013-06-10 02:05:38 +00:00
|
|
|
if bpy.data.is_saved:
|
|
|
|
props = row.operator("wm.open_mainfile", icon='SCREEN_BACK', text="Reload Trusted")
|
|
|
|
props.filepath = bpy.data.filepath
|
|
|
|
props.use_scripts = True
|
|
|
|
|
2013-06-12 00:10:56 +00:00
|
|
|
row.operator("script.autoexec_warn_clear", text="Ignore")
|
2013-06-10 00:42:16 +00:00
|
|
|
return
|
|
|
|
|
2011-07-23 15:36:51 +00:00
|
|
|
row.operator("wm.splash", text="", icon='BLENDER', emboss=False)
|
2013-02-12 07:32:17 +00:00
|
|
|
row.label(text=scene.statistics(), translate=False)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-11-11 13:36:57 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_file(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "File"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2012-04-10 15:56:33 +00:00
|
|
|
layout.operator("wm.read_homefile", text="New", icon='NEW')
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.menu("INFO_MT_file_open_recent", icon='OPEN_RECENT')
|
2010-05-03 03:33:20 +00:00
|
|
|
layout.operator("wm.recover_last_session", icon='RECOVER_LAST')
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.operator("wm.recover_auto_save", text="Recover Auto Save...", icon='RECOVER_AUTO')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2013-01-15 23:15:32 +00:00
|
|
|
layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
|
2012-10-31 17:03:31 +00:00
|
|
|
layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK')
|
|
|
|
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.operator("wm.save_as_mainfile", text="Save As...", icon='SAVE_AS')
|
2010-07-19 17:45:03 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.operator("wm.save_as_mainfile", text="Save Copy...", icon='SAVE_COPY').copy = True
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2009-11-29 23:54:41 +00:00
|
|
|
layout.separator()
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES')
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2013-01-23 12:08:23 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.operator("wm.save_homefile", icon='SAVE_PREFS')
|
2013-01-23 12:08:23 +00:00
|
|
|
layout.operator_context = 'EXEC_AREA'
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.operator("wm.read_factory_settings", icon='LOAD_FACTORY')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.operator("wm.link_append", text="Link", icon='LINK_BLEND')
|
|
|
|
props = layout.operator("wm.link_append", text="Append", icon='APPEND_BLEND')
|
2010-04-06 01:16:39 +00:00
|
|
|
props.link = False
|
|
|
|
props.instance_groups = False
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.menu("INFO_MT_file_import", icon='IMPORT')
|
|
|
|
layout.menu("INFO_MT_file_export", icon='EXPORT')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.menu("INFO_MT_file_external_data", icon='EXTERNAL_DATA')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'EXEC_AREA'
|
2014-01-16 21:42:07 +00:00
|
|
|
if bpy.data.is_dirty and context.user_preferences.view.use_quit_dialog:
|
2013-11-25 09:56:15 +00:00
|
|
|
layout.operator_context = 'INVOKE_SCREEN' # quit dialog
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_file_import(Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "INFO_MT_file_import"
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Import"
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
2013-03-23 06:55:59 +00:00
|
|
|
if bpy.app.build_options.collada:
|
2012-05-20 17:40:57 +00:00
|
|
|
self.layout.operator("wm.collada_import", text="Collada (Default) (.dae)")
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_file_export(Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "INFO_MT_file_export"
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Export"
|
- add torus back from 2.4x as an operator
bpy.ops.mesh.primitive_torus_add(major_radius=1, minor_radius=0.25, major_segments=48, minor_segments=16)
- experemental dynamic menus, used for INFO_MT_file, INFO_MT_file_import, INFO_MT_file_export and INFO_MT_mesh_add. these can have items added from python.
eg.
- removed OBJECT_OT_mesh_add, use the python add menu instead.
- made mesh primitive ops - MESH_OT_primitive_plane_add, ...cube_add, etc. work in object mode.
- RNA scene.active_object wrapped
- bugfix [#19466] 2.5: Tweak menu only available for mesh objects added within Edit Mode
ED_object_exit_editmode was always doing an undo push, made this optional using the existing flag - EM_DO_UNDO, called everywhere except when adding primitives.
2009-10-10 21:23:20 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
2013-03-23 06:55:59 +00:00
|
|
|
if bpy.app.build_options.collada:
|
2012-05-20 17:40:57 +00:00
|
|
|
self.layout.operator("wm.collada_export", text="Collada (Default) (.dae)")
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_file_external_data(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "External Data"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2013-12-23 17:35:32 +00:00
|
|
|
icon = 'CHECKBOX_HLT' if bpy.data.use_autopack else 'CHECKBOX_DEHLT'
|
|
|
|
layout.operator("file.autopack_toggle", icon=icon)
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
pack_all = layout.row()
|
|
|
|
pack_all.operator("file.pack_all")
|
|
|
|
pack_all.active = not bpy.data.use_autopack
|
|
|
|
|
|
|
|
unpack_all = layout.row()
|
|
|
|
unpack_all.operator("file.unpack_all")
|
|
|
|
unpack_all.active = not bpy.data.use_autopack
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("file.make_paths_relative")
|
|
|
|
layout.operator("file.make_paths_absolute")
|
|
|
|
layout.operator("file.report_missing_files")
|
|
|
|
layout.operator("file.find_missing_files")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_game(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Game"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2010-08-18 08:26:18 +00:00
|
|
|
gs = context.scene.game_settings
|
2009-08-18 15:27:48 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("view3d.game_start")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-08-18 15:27:48 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(gs, "show_debug_properties")
|
|
|
|
layout.prop(gs, "show_framerate_profile")
|
|
|
|
layout.prop(gs, "show_physics_visualization")
|
2010-02-22 12:25:58 +00:00
|
|
|
layout.prop(gs, "use_deprecation_warnings")
|
|
|
|
layout.prop(gs, "use_animation_record")
|
2010-03-05 10:37:55 +00:00
|
|
|
layout.separator()
|
2010-08-20 06:09:58 +00:00
|
|
|
layout.prop(gs, "use_auto_start")
|
2009-08-18 15:27:48 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_render(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Render"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("render.render", text="Render Image", icon='RENDER_STILL')
|
|
|
|
layout.operator("render.render", text="Render Animation", icon='RENDER_ANIMATION').animation = True
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-28 18:03:04 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("render.opengl", text="OpenGL Render Image")
|
|
|
|
layout.operator("render.opengl", text="OpenGL Render Animation").animation = True
|
2009-10-28 18:03:04 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-03-08 16:36:53 +00:00
|
|
|
layout.operator("render.view_show")
|
2013-12-14 08:14:33 +00:00
|
|
|
layout.operator("render.play_rendered_anim", icon='PLAY')
|
2012-05-01 13:32:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
class INFO_MT_window(Menu):
|
2012-04-30 19:37:04 +00:00
|
|
|
bl_label = "Window"
|
2012-05-01 13:32:55 +00:00
|
|
|
|
2012-04-30 19:37:04 +00:00
|
|
|
def draw(self, context):
|
|
|
|
import sys
|
2012-05-01 13:32:55 +00:00
|
|
|
|
2012-04-30 19:37:04 +00:00
|
|
|
layout = self.layout
|
2012-05-01 13:32:55 +00:00
|
|
|
|
2012-04-30 19:37:04 +00:00
|
|
|
layout.operator("wm.window_duplicate")
|
|
|
|
layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER')
|
2013-01-28 23:06:27 +00:00
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("screen.screenshot").full = True
|
2013-01-29 01:43:03 +00:00
|
|
|
layout.operator("screen.screencast").full = True
|
2013-01-28 23:06:27 +00:00
|
|
|
|
2012-04-30 19:37:04 +00:00
|
|
|
if sys.platform[:3] == "win":
|
|
|
|
layout.separator()
|
|
|
|
layout.operator("wm.console_toggle", icon='CONSOLE')
|
2012-05-01 13:32:55 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_help(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Help"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2012-06-19 22:17:19 +00:00
|
|
|
layout.operator("wm.url_open", text="Manual", icon='HELP').url = "http://wiki.blender.org/index.php/Doc:2.6/Manual"
|
2013-11-16 23:37:12 +00:00
|
|
|
layout.operator("wm.url_open", text="Release Log", icon='URL').url = "http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.70"
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2012-06-19 22:17:19 +00:00
|
|
|
layout.operator("wm.url_open", text="Blender Website", icon='URL').url = "http://www.blender.org"
|
|
|
|
layout.operator("wm.url_open", text="Blender e-Shop", icon='URL').url = "http://www.blender.org/e-shop"
|
2013-11-16 23:37:12 +00:00
|
|
|
layout.operator("wm.url_open", text="Developer Community", icon='URL').url = "http://www.blender.org/get-involved/"
|
2012-06-19 22:17:19 +00:00
|
|
|
layout.operator("wm.url_open", text="User Community", icon='URL').url = "http://www.blender.org/community/user-community"
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2013-11-16 02:26:04 +00:00
|
|
|
layout.operator("wm.url_open", text="Report a Bug", icon='URL').url = "http://developer.blender.org/maniphest/task/create/?project=2&type=Bug"
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2011-04-14 14:13:04 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("wm.url_open", text="Python API Reference", icon='URL').url = bpy.types.WM_OT_doc_view._prefix
|
2011-09-22 19:50:41 +00:00
|
|
|
layout.operator("wm.operator_cheat_sheet", icon='TEXT')
|
2010-10-16 17:26:40 +00:00
|
|
|
layout.operator("wm.sysinfo", icon='TEXT')
|
2010-08-29 15:40:48 +00:00
|
|
|
layout.separator()
|
2012-05-01 13:32:55 +00:00
|
|
|
|
2011-02-27 17:11:56 +00:00
|
|
|
layout.operator("wm.splash", icon='BLENDER')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
bpy.utils.register_module(__name__)
|