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
|
|
|
|
|
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-12-08 07:12:06 +00:00
|
|
|
window = context.window
|
2009-10-31 19:31:45 +00:00
|
|
|
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)
|
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_operator_search()
|
|
|
|
layout.template_running_jobs()
|
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.label(text=scene.statistics())
|
2009-10-31 19:31:45 +00:00
|
|
|
|
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")
|
2009-11-23 11:43:38 +00:00
|
|
|
layout.operator("wm.link_append", text="Append").link = 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-01-02 23:14:01 +00:00
|
|
|
file = open(os.path.join(bpy.app.home, ".Blog"), "rU")
|
2009-12-28 10:44:02 +00:00
|
|
|
for line in file:
|
|
|
|
line = line.rstrip()
|
|
|
|
layout.operator("wm.open_mainfile", text=line, icon='FILE_BLEND').path = line
|
|
|
|
file.close()
|
|
|
|
|
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):
|
2009-11-23 00:27:30 +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):
|
2009-11-23 00:27:30 +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")
|
|
|
|
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"
|
2009-12-27 23:29:34 +00:00
|
|
|
bl_label = "Add 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')
|
|
|
|
layout.operator_menu_enum("object.metaball_add", "type", 'META', text="Metaball", icon='OUTLINER_OB_META')
|
|
|
|
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'
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator_menu_enum("object.lamp_add", "type", 'LAMP', text="Lamp", icon='OUTLINER_OB_LAMP')
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator_menu_enum("object.effector_add", "type", 'EMPTY', 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'
|
|
|
|
layout.operator("object.group_instance_add", "type", text="Group Instance...", icon='OUTLINER_OB_EMPTY')
|
|
|
|
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")
|
|
|
|
layout.prop(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-11-14 13:35:44 +00:00
|
|
|
# rd = context.scene.render_data
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.operator("screen.render", text="Render Image", icon='RENDER_STILL')
|
|
|
|
layout.operator("screen.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
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("screen.opengl_render", text="OpenGL Render Image")
|
2009-11-23 11:43:38 +00:00
|
|
|
layout.operator("screen.opengl_render", 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
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("screen.render_view_show")
|
2009-12-11 08:05:05 +00:00
|
|
|
layout.operator("screen.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")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
bpy.types.register(INFO_HT_header)
|
|
|
|
bpy.types.register(INFO_MT_file)
|
2009-12-28 10:44:02 +00:00
|
|
|
bpy.types.register(INFO_MT_file_open_recent)
|
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-12-11 14:16:59 +00:00
|
|
|
bpy.types.register(INFO_MT_armature_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)
|
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"
|
|
|
|
_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-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'}
|
|
|
|
|
|
|
|
bpy.types.register(HELP_OT_manual)
|
|
|
|
bpy.types.register(HELP_OT_release_logs)
|
|
|
|
bpy.types.register(HELP_OT_blender_website)
|
|
|
|
bpy.types.register(HELP_OT_blender_eshop)
|
|
|
|
bpy.types.register(HELP_OT_developer_community)
|
|
|
|
bpy.types.register(HELP_OT_user_community)
|
|
|
|
bpy.types.register(HELP_OT_report_bug)
|
|
|
|
bpy.types.register(HELP_OT_python_api)
|
|
|
|
bpy.types.register(HELP_OT_operator_cheat_sheet)
|