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
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
class INFO_HT_header(bpy.types.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
|
|
|
|
Info Header: Non-blocking Info Messages
Reports (i.e. 'info' or 'errors') are now shown in the info header in place of the scene statistics if the last executed operator had some, with this info disappearing again once another operator is run (to show scene statistics again).
For example, this means that info such as the the number of verts merged, or whether a Keying Set successfully inserted keyframes, etc. is now shown again somewhere, and that this is done in a non-blocking manner.
The current implementation is still a bit crude (i.e. lacking fancy polish), but is at least barebones functional. The todos...
* When more than 1 report message is generated by the last operator, there is currently a display of the number of reports. In future, it would be nice to be able to add a button beside this or make the label clickable with appropriate text indicating this (commented out atm) to show popup menu of all the reports...
* There could probably be some kind of coloured backdrop behind the text. Currently using standard box, but that has padding problems, and lacks visual interest.
* Timer based fade out/disappear?
2010-03-02 11:48:40 +00:00
|
|
|
wm = context.manager
|
|
|
|
if wm and len(wm.operators):
|
|
|
|
last_op = wm.operators[-1]
|
|
|
|
else:
|
|
|
|
last_op = None
|
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")
|
|
|
|
sub.menu("INFO_MT_add")
|
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")
|
|
|
|
sub.menu("INFO_MT_help")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-12-08 07:12:06 +00:00
|
|
|
if window.screen.fullscreen:
|
2009-12-10 10:23:53 +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")
|
2009-12-13 13:59:16 +00:00
|
|
|
|
2009-10-31 19:31:45 +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
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if rd.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
|
|
|
|
Info Header: Non-blocking Info Messages
Reports (i.e. 'info' or 'errors') are now shown in the info header in place of the scene statistics if the last executed operator had some, with this info disappearing again once another operator is run (to show scene statistics again).
For example, this means that info such as the the number of verts merged, or whether a Keying Set successfully inserted keyframes, etc. is now shown again somewhere, and that this is done in a non-blocking manner.
The current implementation is still a bit crude (i.e. lacking fancy polish), but is at least barebones functional. The todos...
* When more than 1 report message is generated by the last operator, there is currently a display of the number of reports. In future, it would be nice to be able to add a button beside this or make the label clickable with appropriate text indicating this (commented out atm) to show popup menu of all the reports...
* There could probably be some kind of coloured backdrop behind the text. Currently using standard box, but that has padding problems, and lacks visual interest.
* Timer based fade out/disappear?
2010-03-02 11:48:40 +00:00
|
|
|
if last_op and last_op.has_reports:
|
|
|
|
layout.template_reports_banner(last_op)
|
|
|
|
else:
|
|
|
|
layout.label(text=scene.statistics())
|
2009-10-31 19:31:45 +00:00
|
|
|
|
Info Header: Non-blocking Info Messages
Reports (i.e. 'info' or 'errors') are now shown in the info header in place of the scene statistics if the last executed operator had some, with this info disappearing again once another operator is run (to show scene statistics again).
For example, this means that info such as the the number of verts merged, or whether a Keying Set successfully inserted keyframes, etc. is now shown again somewhere, and that this is done in a non-blocking manner.
The current implementation is still a bit crude (i.e. lacking fancy polish), but is at least barebones functional. The todos...
* When more than 1 report message is generated by the last operator, there is currently a display of the number of reports. In future, it would be nice to be able to add a button beside this or make the label clickable with appropriate text indicating this (commented out atm) to show popup menu of all the reports...
* There could probably be some kind of coloured backdrop behind the text. Currently using standard box, but that has padding problems, and lacks visual interest.
* Timer based fade out/disappear?
2010-03-02 11:48:40 +00:00
|
|
|
# XXX: this should be right-aligned to the RHS of the region
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER', text="")
|
- 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 23:35:56 +00:00
|
|
|
|
2009-10-12 21:06:03 +00:00
|
|
|
class INFO_MT_file(bpy.types.Menu):
|
2009-10-31 19:31:45 +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 = 'EXEC_AREA'
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("wm.read_homefile", text="New", icon='NEW')
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
|
2009-12-28 10:44:02 +00:00
|
|
|
layout.menu("INFO_MT_file_open_recent")
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("wm.recover_last_session")
|
|
|
|
layout.operator("wm.recover_auto_save", text="Recover Auto Save...")
|
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-12-08 00:57:14 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2010-01-27 02:20:24 +00:00
|
|
|
layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK').check_existing = False
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("wm.save_as_mainfile", text="Save As...")
|
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
|
|
|
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES')
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-25 10:20:41 +00:00
|
|
|
layout.operator_context = 'EXEC_AREA'
|
2009-11-29 23:54:41 +00:00
|
|
|
layout.operator("wm.read_homefile", text="Load Factory Settings").factory = True
|
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'
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("wm.link_append", text="Link")
|
2010-04-06 01:16:39 +00:00
|
|
|
props = layout.operator("wm.link_append", text="Append")
|
|
|
|
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
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.menu("INFO_MT_file_import")
|
|
|
|
layout.menu("INFO_MT_file_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
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.menu("INFO_MT_file_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'
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("wm.exit_blender", text="Quit", icon='QUIT')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-12-28 10:44:02 +00:00
|
|
|
class INFO_MT_file_open_recent(bpy.types.Menu):
|
|
|
|
bl_idname = "INFO_MT_file_open_recent"
|
|
|
|
bl_label = "Open Recent..."
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
import os
|
|
|
|
layout = self.layout
|
|
|
|
layout.operator_context = 'EXEC_AREA'
|
2010-02-15 08:17:57 +00:00
|
|
|
|
|
|
|
path = os.path.join(bpy.app.home, ".Blog")
|
|
|
|
|
|
|
|
if os.path.isfile(path):
|
|
|
|
file = open(path, "rU")
|
2010-02-15 01:42:51 +00:00
|
|
|
for line in file:
|
|
|
|
line = line.rstrip()
|
|
|
|
layout.operator("wm.open_mainfile", text=line, icon='FILE_BLEND').path = line
|
|
|
|
file.close()
|
2010-02-15 08:17:57 +00:00
|
|
|
else:
|
2010-02-15 01:42:51 +00:00
|
|
|
layout.label(text='No recent files')
|
2009-12-28 10:44:02 +00:00
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-12-25 22:16:19 +00:00
|
|
|
class INFO_MT_file_import(bpy.types.Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "INFO_MT_file_import"
|
|
|
|
bl_label = "Import"
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
2009-11-11 19:12:52 +00:00
|
|
|
if "collada_import" in dir(bpy.ops.wm):
|
2010-02-15 09:53:02 +00:00
|
|
|
self.layout.operator("wm.collada_import", text="COLLADA (.dae)")
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-12-25 22:16:19 +00:00
|
|
|
class INFO_MT_file_export(bpy.types.Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "INFO_MT_file_export"
|
|
|
|
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):
|
2009-11-11 19:12:52 +00:00
|
|
|
if "collada_export" in dir(bpy.ops.wm):
|
2010-02-15 09:53:02 +00:00
|
|
|
self.layout.operator("wm.collada_export", text="COLLADA (.dae)")
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
class INFO_MT_file_external_data(bpy.types.Menu):
|
2009-10-31 19:31:45 +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
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("file.pack_all", text="Pack into .blend file")
|
2010-02-15 09:53:02 +00:00
|
|
|
layout.operator("file.unpack_all", text="Unpack into Files")
|
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
|
|
|
|
2009-12-25 22:16:19 +00:00
|
|
|
class INFO_MT_mesh_add(bpy.types.Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "INFO_MT_mesh_add"
|
2010-02-17 16:04:06 +00:00
|
|
|
bl_label = "Mesh"
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("mesh.primitive_plane_add", icon='MESH_PLANE', text="Plane")
|
|
|
|
layout.operator("mesh.primitive_cube_add", icon='MESH_CUBE', text="Cube")
|
|
|
|
layout.operator("mesh.primitive_circle_add", icon='MESH_CIRCLE', text="Circle")
|
|
|
|
layout.operator("mesh.primitive_uv_sphere_add", icon='MESH_UVSPHERE', text="UV Sphere")
|
|
|
|
layout.operator("mesh.primitive_ico_sphere_add", icon='MESH_ICOSPHERE', text="Icosphere")
|
|
|
|
layout.operator("mesh.primitive_tube_add", icon='MESH_TUBE', text="Tube")
|
|
|
|
layout.operator("mesh.primitive_cone_add", icon='MESH_CONE', text="Cone")
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("mesh.primitive_grid_add", icon='MESH_GRID', text="Grid")
|
|
|
|
layout.operator("mesh.primitive_monkey_add", icon='MESH_MONKEY', text="Monkey")
|
- 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-12-13 13:59:16 +00:00
|
|
|
|
2009-12-25 22:16:19 +00:00
|
|
|
class INFO_MT_armature_add(bpy.types.Menu):
|
2009-12-11 14:16:59 +00:00
|
|
|
bl_idname = "INFO_MT_armature_add"
|
|
|
|
bl_label = "Armature"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
|
|
|
layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
class INFO_MT_add(bpy.types.Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Add"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'EXEC_SCREEN'
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-12-10 10:23:53 +00:00
|
|
|
#layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
|
|
|
|
layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
|
|
|
|
layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
|
2010-03-23 15:25:33 +00:00
|
|
|
layout.operator_menu_enum("object.metaball_add", "type", text="Metaball", icon='OUTLINER_OB_META')
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-11-07 22:07:46 +00:00
|
|
|
|
2009-11-26 05:57:34 +00:00
|
|
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
2009-12-11 14:16:59 +00:00
|
|
|
layout.menu("INFO_MT_armature_add", icon='OUTLINER_OB_ARMATURE')
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("object.add", text="Lattice", icon='OUTLINER_OB_LATTICE').type = 'LATTICE'
|
|
|
|
layout.operator("object.add", text="Empty", icon='OUTLINER_OB_EMPTY').type = 'EMPTY'
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2010-01-11 06:57:41 +00:00
|
|
|
layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'EXEC_SCREEN'
|
2010-03-23 15:25:33 +00:00
|
|
|
layout.operator_menu_enum("object.lamp_add", "type", text="Lamp", icon='OUTLINER_OB_LAMP')
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2010-03-23 15:25:33 +00:00
|
|
|
layout.operator_menu_enum("object.effector_add", "type", text="Force Field", icon='OUTLINER_OB_EMPTY')
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-01-20 13:38:17 +00:00
|
|
|
if(len(bpy.data.groups) > 10):
|
|
|
|
layout.operator_context = 'INVOKE_DEFAULT'
|
2010-04-01 12:53:38 +00:00
|
|
|
layout.operator("object.group_instance_add", text="Group Instance...", icon='OUTLINER_OB_EMPTY')
|
2010-01-20 13:38:17 +00:00
|
|
|
else:
|
|
|
|
layout.operator_menu_enum("object.group_instance_add", "type", text="Group Instance", icon='OUTLINER_OB_EMPTY')
|
- 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 23:35:56 +00:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
class INFO_MT_game(bpy.types.Menu):
|
2009-10-31 19:31:45 +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
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
gs = context.scene.game_data
|
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()
|
|
|
|
layout.prop(gs, "auto_start")
|
2009-08-18 15:27:48 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
class INFO_MT_render(bpy.types.Menu):
|
2009-10-31 19:31:45 +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
|
|
|
|
2010-02-23 12:48:35 +00:00
|
|
|
# rd = context.scene.render
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2010-03-08 16:36:53 +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
|
|
|
|
2010-03-08 16:36:53 +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")
|
|
|
|
layout.operator("render.play_rendered_anim")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
class INFO_MT_help(bpy.types.Menu):
|
2009-10-31 19:31:45 +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
|
|
|
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("help.manual", icon='HELP')
|
|
|
|
layout.operator("help.release_logs", icon='URL')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("help.blender_website", icon='URL')
|
|
|
|
layout.operator("help.blender_eshop", icon='URL')
|
|
|
|
layout.operator("help.developer_community", icon='URL')
|
|
|
|
layout.operator("help.user_community", icon='URL')
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("help.report_bug", icon='URL')
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("help.python_api", icon='URL')
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("help.operator_cheat_sheet")
|
2010-03-29 08:27:04 +00:00
|
|
|
layout.separator()
|
|
|
|
layout.operator("wm.splash")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
# Help operators
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
class HelpOperator(bpy.types.Operator):
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def execute(self, context):
|
|
|
|
import webbrowser
|
|
|
|
webbrowser.open(self._url)
|
2009-12-24 19:50:43 +00:00
|
|
|
return {'FINISHED'}
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
class HELP_OT_manual(HelpOperator):
|
2009-10-31 19:31:45 +00:00
|
|
|
'''The Blender Wiki manual'''
|
|
|
|
bl_idname = "help.manual"
|
|
|
|
bl_label = "Manual"
|
2009-11-24 11:58:49 +00:00
|
|
|
_url = 'http://wiki.blender.org/index.php/Doc:Manual'
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
class HELP_OT_release_logs(HelpOperator):
|
2009-10-31 19:31:45 +00:00
|
|
|
'''Information about the changes in this version of Blender'''
|
|
|
|
bl_idname = "help.release_logs"
|
2009-11-23 15:41:57 +00:00
|
|
|
bl_label = "Release Log"
|
|
|
|
_url = 'http://www.blender.org/development/release-logs/blender-250/'
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
class HELP_OT_blender_website(HelpOperator):
|
2009-10-31 19:31:45 +00:00
|
|
|
'''The official Blender website'''
|
|
|
|
bl_idname = "help.blender_website"
|
|
|
|
bl_label = "Blender Website"
|
|
|
|
_url = 'http://www.blender.org/'
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
class HELP_OT_blender_eshop(HelpOperator):
|
2009-10-31 19:31:45 +00:00
|
|
|
'''Buy official Blender resources and merchandise online'''
|
|
|
|
bl_idname = "help.blender_eshop"
|
|
|
|
bl_label = "Blender e-Shop"
|
2010-04-05 06:45:44 +00:00
|
|
|
_url = 'http://www.blender.org/e-shop'
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
class HELP_OT_developer_community(HelpOperator):
|
2009-10-31 19:31:45 +00:00
|
|
|
'''Get involved with Blender development'''
|
|
|
|
bl_idname = "help.developer_community"
|
|
|
|
bl_label = "Developer Community"
|
|
|
|
_url = 'http://www.blender.org/community/get-involved/'
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
class HELP_OT_user_community(HelpOperator):
|
2009-10-31 19:31:45 +00:00
|
|
|
'''Get involved with other Blender users'''
|
|
|
|
bl_idname = "help.user_community"
|
|
|
|
bl_label = "User Community"
|
|
|
|
_url = 'http://www.blender.org/community/user-community/'
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-27 23:28:56 +00:00
|
|
|
class HELP_OT_report_bug(HelpOperator):
|
2009-10-31 19:31:45 +00:00
|
|
|
'''Report a bug in the Blender bug tracker'''
|
|
|
|
bl_idname = "help.report_bug"
|
|
|
|
bl_label = "Report a Bug"
|
|
|
|
_url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-11-23 15:20:56 +00:00
|
|
|
class HELP_OT_python_api(HelpOperator):
|
|
|
|
'''Reference for operator and data Python API'''
|
|
|
|
bl_idname = "help.python_api"
|
|
|
|
bl_label = "Python API Reference"
|
2010-01-14 02:13:08 +00:00
|
|
|
_url = 'http://www.blender.org/documentation/250PythonDoc/contents.html'
|
2009-11-23 15:20:56 +00:00
|
|
|
|
|
|
|
|
2009-09-16 06:02:56 +00:00
|
|
|
class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "help.operator_cheat_sheet"
|
|
|
|
bl_label = "Operator Cheat Sheet (new textblock)"
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def execute(self, context):
|
|
|
|
op_strings = []
|
|
|
|
tot = 0
|
|
|
|
for op_module_name in dir(bpy.ops):
|
|
|
|
op_module = getattr(bpy.ops, op_module_name)
|
|
|
|
for op_submodule_name in dir(op_module):
|
|
|
|
op = getattr(op_module, op_submodule_name)
|
|
|
|
text = repr(op)
|
|
|
|
if text.startswith('bpy.ops.'):
|
|
|
|
op_strings.append(text)
|
|
|
|
tot += 1
|
|
|
|
|
|
|
|
op_strings.append('')
|
|
|
|
|
2010-01-11 00:41:31 +00:00
|
|
|
textblock = bpy.data.texts.new("OperatorList.txt")
|
2009-10-31 19:31:45 +00:00
|
|
|
textblock.write('# %d Operators\n\n' % tot)
|
|
|
|
textblock.write('\n'.join(op_strings))
|
2010-01-11 00:41:31 +00:00
|
|
|
self.report({'INFO'}, "See OperatorList.txt textblock")
|
2009-12-24 19:50:43 +00:00
|
|
|
return {'FINISHED'}
|
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
|
|
|
|
classes = [
|
|
|
|
INFO_HT_header,
|
|
|
|
INFO_MT_file,
|
|
|
|
INFO_MT_file_open_recent,
|
|
|
|
INFO_MT_file_import,
|
|
|
|
INFO_MT_file_export,
|
|
|
|
INFO_MT_file_external_data,
|
|
|
|
INFO_MT_add,
|
|
|
|
INFO_MT_mesh_add,
|
|
|
|
INFO_MT_armature_add,
|
|
|
|
INFO_MT_game,
|
|
|
|
INFO_MT_render,
|
|
|
|
INFO_MT_help,
|
|
|
|
|
|
|
|
HELP_OT_manual,
|
|
|
|
HELP_OT_release_logs,
|
|
|
|
HELP_OT_blender_website,
|
|
|
|
HELP_OT_blender_eshop,
|
|
|
|
HELP_OT_developer_community,
|
|
|
|
HELP_OT_user_community,
|
|
|
|
HELP_OT_report_bug,
|
|
|
|
HELP_OT_python_api,
|
|
|
|
HELP_OT_operator_cheat_sheet]
|
|
|
|
|
|
|
|
|
|
|
|
def register():
|
|
|
|
register = bpy.types.register
|
|
|
|
for cls in classes:
|
|
|
|
register(cls)
|
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def unregister():
|
|
|
|
unregister = bpy.types.unregister
|
|
|
|
for cls in classes:
|
|
|
|
unregister(cls)
|
2010-02-16 09:55:07 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|