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
2010-09-02 04:53:05 +00:00
wm = context . window_manager
2009-12-08 07:12:06 +00:00
window = context . window
2010-11-11 13:36:57 +00:00
sinfo = context . space_data
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
2010-08-17 17:03:52 +00:00
if window . screen . show_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
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 ( )
2010-06-09 19:12:03 +00:00
2010-06-03 07:27:55 +00:00
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
2010-11-11 13:36:57 +00:00
# XXX: BEFORE RELEASE, MOVE FILE MENU OUT OF INFO!!!
"""
row = layout . row ( align = True )
row . prop ( sinfo , " show_report_debug " , text = " Debug " )
row . prop ( sinfo , " show_report_info " , text = " Info " )
row . prop ( sinfo , " show_report_operator " , text = " Operators " )
row . prop ( sinfo , " show_report_warning " , text = " Warnings " )
row . prop ( sinfo , " show_report_error " , text = " Errors " )
row = layout . row ( )
row . enabled = sinfo . show_report_operator
row . operator ( " info.report_replay " )
row . menu ( " INFO_MT_report " )
"""
class INFO_MT_report ( bpy . types . Menu ) :
bl_label = " Report "
def draw ( self , context ) :
layout = self . layout
layout . column ( )
layout . operator ( " console.select_all_toggle " )
layout . operator ( " console.select_border " )
layout . operator ( " console.report_delete " )
layout . operator ( " console.report_copy " )
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 " )
2010-05-03 03:33:20 +00:00
layout . operator ( " wm.recover_last_session " , icon = ' RECOVER_LAST ' )
2009-11-23 00:27:30 +00:00
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... " )
2010-07-19 17:45:03 +00:00
layout . operator_context = ' INVOKE_AREA '
layout . operator ( " wm.save_as_mainfile " , text = " 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
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 '
2010-11-09 07:49:15 +00:00
layout . operator ( " wm.save_homefile " )
2010-10-02 16:19:33 +00:00
layout . operator ( " wm.read_factory_settings " )
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 '
2010-10-11 22:05:45 +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
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 ) :
2010-08-10 18:21:33 +00:00
if hasattr ( bpy . types , " WM_OT_collada_import " ) :
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 ) :
2010-08-10 18:21:33 +00:00
if hasattr ( bpy . types , " WM_OT_collada_export " ) :
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 " )
2010-09-01 21:11:33 +00:00
layout . operator ( " mesh.primitive_cylinder_add " , icon = ' MESH_CYLINDER ' , text = " Cylinder " )
2009-12-10 10:23:53 +00:00
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
2010-06-09 19:12:03 +00:00
2010-05-23 02:02:04 +00:00
class INFO_MT_curve_add ( bpy . types . Menu ) :
bl_idname = " INFO_MT_curve_add "
bl_label = " Curve "
def draw ( self , context ) :
layout = self . layout
layout . operator_context = ' INVOKE_REGION_WIN '
2010-05-24 07:14:55 +00:00
layout . operator ( " curve.primitive_bezier_curve_add " , icon = ' CURVE_BEZCURVE ' , text = " Bezier " )
2010-05-23 02:02:04 +00:00
layout . operator ( " curve.primitive_bezier_circle_add " , icon = ' CURVE_BEZCIRCLE ' , text = " Circle " )
layout . operator ( " curve.primitive_nurbs_curve_add " , icon = ' CURVE_NCURVE ' , text = " Nurbs Curve " )
layout . operator ( " curve.primitive_nurbs_circle_add " , icon = ' CURVE_NCIRCLE ' , text = " Nurbs Circle " )
2010-05-24 07:14:55 +00:00
layout . operator ( " curve.primitive_nurbs_path_add " , icon = ' CURVE_PATH ' , text = " Path " )
2009-12-13 13:59:16 +00:00
2010-09-29 11:48:03 +00:00
class INFO_MT_edit_curve_add ( bpy . types . Menu ) :
bl_idname = " INFO_MT_edit_curve_add "
bl_label = " Add "
def draw ( self , context ) :
is_surf = context . active_object . type == ' SURFACE '
layout = self . layout
layout . operator_context = ' INVOKE_REGION_WIN '
if is_surf :
INFO_MT_surface_add . draw ( self , context )
else :
INFO_MT_curve_add . draw ( self , context )
2010-07-05 22:22:22 +00:00
2010-06-13 05:48:21 +00:00
class INFO_MT_surface_add ( bpy . types . Menu ) :
bl_idname = " INFO_MT_surface_add "
bl_label = " Surface "
def draw ( self , context ) :
layout = self . layout
layout . operator_context = ' INVOKE_REGION_WIN '
layout . operator ( " surface.primitive_nurbs_surface_curve_add " , icon = ' SURFACE_NCURVE ' , text = " NURBS Curve " )
layout . operator ( " surface.primitive_nurbs_surface_circle_add " , icon = ' SURFACE_NCIRCLE ' , text = " NURBS Circle " )
layout . operator ( " surface.primitive_nurbs_surface_surface_add " , icon = ' SURFACE_NSURFACE ' , text = " NURBS Surface " )
2010-09-01 21:11:33 +00:00
layout . operator ( " surface.primitive_nurbs_surface_cylinder_add " , icon = ' SURFACE_NCYLINDER ' , text = " NURBS Cylinder " )
2010-06-13 05:48:21 +00:00
layout . operator ( " surface.primitive_nurbs_surface_sphere_add " , icon = ' SURFACE_NSPHERE ' , text = " NURBS Sphere " )
2010-09-01 20:18:31 +00:00
layout . operator ( " surface.primitive_nurbs_surface_torus_add " , icon = ' SURFACE_NTORUS ' , text = " NURBS Torus " )
2010-06-09 19:12:03 +00:00
2010-10-11 18:53:11 +00:00
class INFO_MT_curve_handle_type_set ( bpy . types . Menu ) :
bl_idname = " INFO_MT_curve_handle_type_set "
bl_label = " Handle Type "
def draw ( self , context ) :
layout = self . layout
layout . operator_context = ' INVOKE_REGION_WIN '
layout . operator ( " curve.handle_type_set " , text = " Automatic " ) . type = " AUTOMATIC "
layout . operator ( " curve.handle_type_set " , text = " Vector " ) . type = " VECTOR "
layout . operator ( " curve.handle_type_set " , text = " Align " ) . type = " ALIGN "
layout . operator ( " curve.handle_type_set " , text = " Free Align " ) . type = " FREE_ALIGN "
2010-07-05 22:22:22 +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
2010-05-23 02:02:04 +00:00
#layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
layout . menu ( " INFO_MT_curve_add " , icon = ' OUTLINER_OB_CURVE ' )
2010-06-13 05:48:21 +00:00
#layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
layout . menu ( " INFO_MT_surface_add " , 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 ' )
2010-10-01 12:25:18 +00:00
layout . operator_context = ' INVOKE_REGION_WIN '
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-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 :
2010-05-21 04:44:23 +00:00
layout . operator_menu_enum ( " object.group_instance_add " , " group " , 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
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
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
2010-05-31 11:38:13 +00:00
layout . operator ( " wm.url_open " , text = " Manual " , icon = ' HELP ' ) . url = ' http://wiki.blender.org/index.php/Doc:Manual '
2010-09-26 08:27:59 +00:00
layout . operator ( " wm.url_open " , text = " Release Log " , icon = ' URL ' ) . url = ' http://www.blender.org/development/release-logs/blender-254-beta/ '
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
2010-05-31 11:38:13 +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 '
layout . operator ( " wm.url_open " , text = " Developer Community " , icon = ' URL ' ) . url = ' http://www.blender.org/community/get-involved/ '
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 ( )
2010-05-31 11:38:13 +00:00
layout . operator ( " wm.url_open " , text = " Report a Bug " , icon = ' URL ' ) . url = ' http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse '
2009-11-23 00:27:30 +00:00
layout . separator ( )
2010-09-03 09:21:40 +00:00
layout . operator ( " wm.url_open " , text = " Python API Reference " , icon = ' URL ' ) . url = " http://www.blender.org/documentation/blender_python_api_ %s /contents.html " % " _ " . join ( str ( v ) for v in bpy . app . version )
2010-08-29 15:40:48 +00:00
layout . operator ( " help.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 ( )
2010-10-18 22:37:21 +00:00
if bpy . app . build_platform [ 0 : 7 ] == ' Windows ' :
layout . operator ( " wm.toggle_console " , icon = ' CONSOLE ' )
layout . separator ( )
2010-08-29 15:40:48 +00:00
layout . operator ( " anim.update_data_paths " , text = " FCurve/Driver 2.54 fix " , icon = ' HELP ' )
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-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 "
2010-07-12 11:02:01 +00:00
bl_label = " Operator Cheat Sheet "
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 )
2010-10-08 21:18:08 +00:00
if text . split ( " \n " ) [ - 1 ] . startswith ( ' bpy.ops. ' ) :
2009-10-31 19:31:45 +00:00
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
def register ( ) :
2010-08-02 02:55:12 +00:00
pass
2010-02-14 11:21:21 +00:00
2010-02-22 23:32:58 +00:00
2010-02-14 11:21:21 +00:00
def unregister ( ) :
2010-08-02 02:55:12 +00:00
pass
2010-02-16 09:55:07 +00:00
if __name__ == " __main__ " :
register ( )