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,
|
|
|
|
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
#
|
|
|
|
# ##### 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
|
|
|
|
|
- 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
|
|
|
import dynamic_menu
|
|
|
|
# reload(dynamic_menu)
|
|
|
|
|
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
|
2009-08-19 00:55:30 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
st = context.space_data
|
|
|
|
scene = context.scene
|
|
|
|
rd = scene.render_data
|
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)
|
|
|
|
sub.itemM("INFO_MT_file")
|
|
|
|
sub.itemM("INFO_MT_add")
|
|
|
|
if rd.use_game_engine:
|
|
|
|
sub.itemM("INFO_MT_game")
|
|
|
|
else:
|
|
|
|
sub.itemM("INFO_MT_render")
|
|
|
|
sub.itemM("INFO_MT_help")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
|
|
|
|
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-01 18:05:01 +00:00
|
|
|
layout.itemS()
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if rd.multiple_engines:
|
|
|
|
layout.itemR(rd, "engine", text="")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
2009-08-19 12:35:40 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.template_operator_search()
|
|
|
|
layout.template_running_jobs()
|
|
|
|
|
|
|
|
layout.itemL(text=scene.statistics())
|
|
|
|
|
2009-11-01 18:05:01 +00:00
|
|
|
layout.itemO("wm.window_fullscreen_toggle", icon='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-10-31 19:31:45 +00:00
|
|
|
layout.operator_context = "EXEC_AREA"
|
|
|
|
layout.itemO("wm.read_homefile", text="New", icon='ICON_NEW')
|
|
|
|
layout.operator_context = "INVOKE_AREA"
|
|
|
|
layout.itemO("wm.open_mainfile", text="Open...", icon='ICON_FILE_FOLDER')
|
|
|
|
layout.item_menu_enumO("wm.open_recentfile", "file", text="Open Recent")
|
|
|
|
layout.itemO("wm.recover_last_session")
|
|
|
|
layout.itemO("wm.recover_auto_save", text="Recover Auto Save...")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.operator_context = "EXEC_AREA"
|
|
|
|
layout.itemO("wm.save_mainfile", text="Save", icon='ICON_FILE_TICK')
|
|
|
|
layout.operator_context = "INVOKE_AREA"
|
|
|
|
layout.itemO("wm.save_as_mainfile", text="Save As...")
|
|
|
|
layout.itemO("screen.userpref_show", text="User Preferences...", icon='ICON_PREFERENCES')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
|
|
|
layout.operator_context = "INVOKE_AREA"
|
|
|
|
layout.itemO("wm.link_append", text="Link")
|
|
|
|
layout.item_booleanO("wm.link_append", "link", False, text="Append")
|
|
|
|
layout.itemS()
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemM("INFO_MT_file_import")
|
|
|
|
layout.itemM("INFO_MT_file_export")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemM("INFO_MT_file_external_data")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.operator_context = "EXEC_AREA"
|
|
|
|
layout.itemO("wm.exit_blender", text="Quit", icon='ICON_QUIT')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
- 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
|
|
|
# test for expanding menus
|
|
|
|
'''
|
|
|
|
class INFO_MT_file_more(INFO_MT_file):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "File"
|
2009-07-23 21:35:11 +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
|
|
|
layout.itemO("wm.read_homefile", text="TESTING ")
|
- 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
|
|
|
|
|
|
|
dynamic_menu.setup(INFO_MT_file_more)
|
|
|
|
'''
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
- 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
|
|
|
class INFO_MT_file_import(dynamic_menu.DynMenu):
|
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):
|
|
|
|
self.layout.itemO("WM_OT_collada_import", text="COLLADA (.dae)...")
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
- 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
|
|
|
class INFO_MT_file_export(dynamic_menu.DynMenu):
|
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):
|
|
|
|
self.layout.itemO("WM_OT_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-10-31 19:31:45 +00:00
|
|
|
layout.itemO("file.pack_all", text="Pack into .blend file")
|
|
|
|
layout.itemO("file.unpack_all", text="Unpack into Files...")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemO("file.make_paths_relative")
|
|
|
|
layout.itemO("file.make_paths_absolute")
|
|
|
|
layout.itemO("file.report_missing_files")
|
|
|
|
layout.itemO("file.find_missing_files")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
- 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
|
|
|
class INFO_MT_mesh_add(dynamic_menu.DynMenu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "INFO_MT_mesh_add"
|
|
|
|
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'
|
|
|
|
layout.itemO("mesh.primitive_plane_add", icon='ICON_MESH_PLANE', text="Plane")
|
|
|
|
layout.itemO("mesh.primitive_cube_add", icon='ICON_MESH_CUBE', text="Cube")
|
|
|
|
layout.itemO("mesh.primitive_circle_add", icon='ICON_MESH_CIRCLE', text="Circle")
|
|
|
|
layout.itemO("mesh.primitive_uv_sphere_add", icon='ICON_MESH_UVSPHERE', text="UV Sphere")
|
|
|
|
layout.itemO("mesh.primitive_ico_sphere_add", icon='ICON_MESH_ICOSPHERE', text="Icosphere")
|
|
|
|
layout.itemO("mesh.primitive_tube_add", icon='ICON_MESH_TUBE', text="Tube")
|
|
|
|
layout.itemO("mesh.primitive_cone_add", icon='ICON_MESH_CONE', text="Cone")
|
|
|
|
layout.itemS()
|
|
|
|
layout.itemO("mesh.primitive_grid_add", icon='ICON_MESH_GRID', text="Grid")
|
|
|
|
layout.itemO("mesh.primitive_monkey_add", icon='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-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
|
|
|
|
|
|
|
|
layout.operator_context = "EXEC_SCREEN"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
# layout.item_menu_enumO("object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
|
|
|
|
layout.itemM("INFO_MT_mesh_add", icon='ICON_OUTLINER_OB_MESH')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.item_menu_enumO("object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
|
|
|
|
layout.item_menu_enumO("object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
|
|
|
|
layout.item_menu_enumO("object.metaball_add", "type", 'META', text="Metaball", icon='ICON_OUTLINER_OB_META')
|
|
|
|
layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
2009-11-04 09:45:37 +00:00
|
|
|
|
|
|
|
layout.operator_context = "INVOKE_SCREEN"
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
|
|
|
|
layout.item_enumO("object.add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE')
|
|
|
|
layout.item_enumO("object.add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.item_enumO("object.add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA')
|
2009-11-04 09:45:37 +00:00
|
|
|
|
|
|
|
layout.operator_context = "EXEC_SCREEN"
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.item_menu_enumO("object.lamp_add", "type", 'LAMP', text="Lamp", icon='ICON_OUTLINER_OB_LAMP')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.item_menu_enumO("object.effector_add", "type", 'EMPTY', text="Force Field", icon='ICON_OUTLINER_OB_EMPTY')
|
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
layout.item_menu_enumO("object.group_instance_add", "type", text="Group Instance", icon='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-10-31 19:31:45 +00:00
|
|
|
layout.itemO("view3d.game_start")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
2009-08-18 15:27:48 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemR(gs, "show_debug_properties")
|
|
|
|
layout.itemR(gs, "show_framerate_profile")
|
|
|
|
layout.itemR(gs, "show_physics_visualization")
|
|
|
|
layout.itemR(gs, "deprecation_warnings")
|
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
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
rd = context.scene.render_data
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemO("screen.render", text="Render Image", icon='ICON_RENDER_STILL')
|
|
|
|
layout.item_booleanO("screen.render", "animation", True, text="Render Animation", icon='ICON_RENDER_ANIMATION')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
2009-10-28 18:03:04 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemO("screen.opengl_render", text="OpenGL Render Image")
|
|
|
|
layout.item_booleanO("screen.opengl_render", "animation", True, text="OpenGL Render Animation")
|
2009-10-28 18:03:04 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
layout.itemO("screen.render_view_show")
|
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-10-31 19:31:45 +00:00
|
|
|
layout.itemO("help.manual", icon='ICON_HELP')
|
|
|
|
layout.itemO("help.release_logs", icon='ICON_URL')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemS()
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.itemO("help.blender_website", icon='ICON_URL')
|
|
|
|
layout.itemO("help.blender_eshop", icon='ICON_URL')
|
|
|
|
layout.itemO("help.developer_community", icon='ICON_URL')
|
|
|
|
layout.itemO("help.user_community", icon='ICON_URL')
|
|
|
|
layout.itemS()
|
|
|
|
layout.itemO("help.report_bug", icon='ICON_URL')
|
|
|
|
layout.itemS()
|
|
|
|
layout.itemO("help.operator_cheat_sheet")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
bpy.types.register(INFO_HT_header)
|
|
|
|
bpy.types.register(INFO_MT_file)
|
2009-07-23 21:35:11 +00:00
|
|
|
bpy.types.register(INFO_MT_file_import)
|
|
|
|
bpy.types.register(INFO_MT_file_export)
|
2009-06-30 19:20:45 +00:00
|
|
|
bpy.types.register(INFO_MT_file_external_data)
|
|
|
|
bpy.types.register(INFO_MT_add)
|
- 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
|
|
|
bpy.types.register(INFO_MT_mesh_add)
|
2009-06-30 19:20:45 +00:00
|
|
|
bpy.types.register(INFO_MT_game)
|
|
|
|
bpy.types.register(INFO_MT_render)
|
|
|
|
bpy.types.register(INFO_MT_help)
|
|
|
|
|
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)
|
|
|
|
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"
|
|
|
|
_url = 'http://wiki.blender.org/index.php/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"
|
|
|
|
bl_label = "Release Logs"
|
|
|
|
_url = 'http://www.blender.org/development/release-logs/'
|
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"
|
|
|
|
_url = 'http://www.blender3d.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-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('')
|
|
|
|
|
|
|
|
bpy.ops.text.new() # XXX - assumes new text is always at the end!
|
|
|
|
textblock = bpy.data.texts[-1]
|
|
|
|
textblock.write('# %d Operators\n\n' % tot)
|
|
|
|
textblock.write('\n'.join(op_strings))
|
|
|
|
textblock.name = "OperatorList.txt"
|
|
|
|
print("See OperatorList.txt textblock")
|
|
|
|
return ('FINISHED',)
|
2009-09-16 06:02:56 +00:00
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
bpy.ops.add(HELP_OT_manual)
|
|
|
|
bpy.ops.add(HELP_OT_release_logs)
|
|
|
|
bpy.ops.add(HELP_OT_blender_website)
|
|
|
|
bpy.ops.add(HELP_OT_blender_eshop)
|
|
|
|
bpy.ops.add(HELP_OT_developer_community)
|
|
|
|
bpy.ops.add(HELP_OT_user_community)
|
2009-10-27 23:28:56 +00:00
|
|
|
bpy.ops.add(HELP_OT_report_bug)
|
2009-09-16 06:02:56 +00:00
|
|
|
bpy.ops.add(HELP_OT_operator_cheat_sheet)
|