2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-06-30 19:20:45 +00:00
|
|
|
import bpy
|
2011-09-22 19:50:41 +00:00
|
|
|
from bpy.types import Header, Menu
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_HT_header(Header):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'INFO'
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2010-03-06 01:40:29 +00:00
|
|
|
|
2009-12-08 07:12:06 +00:00
|
|
|
window = context.window
|
2009-10-31 19:31:45 +00:00
|
|
|
scene = context.scene
|
2010-02-23 12:48:35 +00:00
|
|
|
rd = scene.render
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.template_header()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if context.area.show_menus:
|
|
|
|
sub = row.row(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("INFO_MT_file")
|
|
|
|
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")
|
2012-04-30 19:37:04 +00:00
|
|
|
sub.menu("INFO_MT_window")
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("INFO_MT_help")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2010-08-17 17:03:52 +00:00
|
|
|
if window.screen.show_fullscreen:
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text="Back to Previous")
|
2009-12-08 07:12:06 +00:00
|
|
|
layout.separator()
|
|
|
|
else:
|
|
|
|
layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
|
2011-02-01 13:35:21 +00:00
|
|
|
layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete")
|
2.5: Render/Game Engine
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.
* Top header now has an engine menu, to choose between the blender
render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
only properties that work in the game engine, and similarly for
the render engine.
* Moved panels from the logic space and game tabs to the physics,
scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
specific too, to better show what is supported.
2009-07-23 21:50:40 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-11-01 18:05:01 +00:00
|
|
|
|
2010-08-18 04:10:23 +00:00
|
|
|
if rd.has_multiple_engines:
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(rd, "engine", text="")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-08-19 12:35:40 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.template_running_jobs()
|
2010-03-06 01:40:29 +00:00
|
|
|
|
2010-06-03 07:27:55 +00:00
|
|
|
layout.template_reports_banner()
|
2011-07-29 01:24:03 +00:00
|
|
|
|
2011-07-23 15:36:51 +00:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.operator("wm.splash", text="", icon='BLENDER', emboss=False)
|
|
|
|
row.label(text=scene.statistics())
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-11-11 13:36:57 +00:00
|
|
|
# XXX: BEFORE RELEASE, MOVE FILE MENU OUT OF INFO!!!
|
|
|
|
"""
|
2011-02-17 04:35:41 +00:00
|
|
|
sinfo = context.space_data
|
2010-11-11 13:36:57 +00:00
|
|
|
row = layout.row(align=True)
|
2011-09-21 15:18:38 +00:00
|
|
|
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")
|
2010-11-11 13:36:57 +00:00
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.enabled = sinfo.show_report_operator
|
|
|
|
row.operator("info.report_replay")
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2010-11-11 13:36:57 +00:00
|
|
|
row.menu("INFO_MT_report")
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_report(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Report"
|
2010-11-11 13:36:57 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-08-13 17:52:13 +00:00
|
|
|
|
2010-11-11 13:36:57 +00:00
|
|
|
layout.operator("console.select_all_toggle")
|
|
|
|
layout.operator("console.select_border")
|
|
|
|
layout.operator("console.report_delete")
|
|
|
|
layout.operator("console.report_copy")
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_file(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "File"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2012-04-10 15:56:33 +00:00
|
|
|
layout.operator("wm.read_homefile", text="New", icon='NEW')
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER')
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.menu("INFO_MT_file_open_recent", icon='OPEN_RECENT')
|
2010-05-03 03:33:20 +00:00
|
|
|
layout.operator("wm.recover_last_session", icon='RECOVER_LAST')
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.operator("wm.recover_auto_save", text="Recover Auto Save...", icon='RECOVER_AUTO')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-12-08 00:57:14 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2011-09-21 15:18:38 +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'
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.operator("wm.save_as_mainfile", text="Save As...", icon='SAVE_AS')
|
2010-07-19 17:45:03 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.operator("wm.save_as_mainfile", text="Save Copy...", icon='SAVE_COPY').copy = True
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2009-11-29 23:54:41 +00:00
|
|
|
layout.separator()
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("screen.userpref_show", text="User Preferences...", icon='PREFERENCES')
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-25 10:20:41 +00:00
|
|
|
layout.operator_context = 'EXEC_AREA'
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.operator("wm.save_homefile", icon='SAVE_PREFS')
|
|
|
|
layout.operator("wm.read_factory_settings", icon='LOAD_FACTORY')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'INVOKE_AREA'
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.operator("wm.link_append", text="Link", icon='LINK_BLEND')
|
|
|
|
props = layout.operator("wm.link_append", text="Append", icon='APPEND_BLEND')
|
2010-04-06 01:16:39 +00:00
|
|
|
props.link = False
|
|
|
|
props.instance_groups = False
|
2009-12-04 17:54:48 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.menu("INFO_MT_file_import", icon='IMPORT')
|
|
|
|
layout.menu("INFO_MT_file_export", icon='EXPORT')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2012-03-15 14:36:54 +00:00
|
|
|
layout.menu("INFO_MT_file_external_data", icon='EXTERNAL_DATA')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'EXEC_AREA'
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_file_import(Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "INFO_MT_file_import"
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Import"
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
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
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_file_export(Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "INFO_MT_file_export"
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Export"
|
- add torus back from 2.4x as an operator
bpy.ops.mesh.primitive_torus_add(major_radius=1, minor_radius=0.25, major_segments=48, minor_segments=16)
- experemental dynamic menus, used for INFO_MT_file, INFO_MT_file_import, INFO_MT_file_export and INFO_MT_mesh_add. these can have items added from python.
eg.
- removed OBJECT_OT_mesh_add, use the python add menu instead.
- made mesh primitive ops - MESH_OT_primitive_plane_add, ...cube_add, etc. work in object mode.
- RNA scene.active_object wrapped
- bugfix [#19466] 2.5: Tweak menu only available for mesh objects added within Edit Mode
ED_object_exit_editmode was always doing an undo push, made this optional using the existing flag - EM_DO_UNDO, called everywhere except when adding primitives.
2009-10-10 21:23:20 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
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
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_file_external_data(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "External Data"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2011-09-21 15:18:38 +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
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_mesh_add(Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "INFO_MT_mesh_add"
|
2011-09-15 13:20:18 +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
|
2011-08-22 09:01:49 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
2011-09-21 15:18:38 +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_cylinder_add", icon='MESH_CYLINDER', text="Cylinder")
|
|
|
|
layout.operator("mesh.primitive_cone_add", icon='MESH_CONE', text="Cone")
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("mesh.primitive_grid_add", icon='MESH_GRID', text="Grid")
|
|
|
|
layout.operator("mesh.primitive_monkey_add", icon='MESH_MONKEY', text="Monkey")
|
|
|
|
layout.operator("mesh.primitive_torus_add", text="Torus", icon='MESH_TORUS')
|
- 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
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_curve_add(Menu):
|
2010-05-23 02:02:04 +00:00
|
|
|
bl_idname = "INFO_MT_curve_add"
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Curve"
|
2010-05-23 02:02:04 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-08-22 09:01:49 +00:00
|
|
|
|
2010-05-23 02:02:04 +00:00
|
|
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("curve.primitive_bezier_curve_add", icon='CURVE_BEZCURVE', text="Bezier")
|
|
|
|
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")
|
|
|
|
layout.operator("curve.primitive_nurbs_path_add", icon='CURVE_PATH', text="Path")
|
2009-12-13 13:59:16 +00:00
|
|
|
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_edit_curve_add(Menu):
|
2010-09-29 11:48:03 +00:00
|
|
|
bl_idname = "INFO_MT_edit_curve_add"
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Add"
|
2010-09-29 11:48:03 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
is_surf = context.active_object.type == 'SURFACE'
|
|
|
|
|
|
|
|
layout = self.layout
|
|
|
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
|
|
|
|
|
|
|
if is_surf:
|
2011-01-01 07:20:34 +00:00
|
|
|
INFO_MT_surface_add.draw(self, context)
|
2010-09-29 11:48:03 +00:00
|
|
|
else:
|
2011-01-01 07:20:34 +00:00
|
|
|
INFO_MT_curve_add.draw(self, context)
|
2010-09-29 11:48:03 +00:00
|
|
|
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_surface_add(Menu):
|
2010-06-13 05:48:21 +00:00
|
|
|
bl_idname = "INFO_MT_surface_add"
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Surface"
|
2010-06-13 05:48:21 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-08-22 09:01:49 +00:00
|
|
|
|
2010-06-13 05:48:21 +00:00
|
|
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
2011-09-21 15:18:38 +00:00
|
|
|
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")
|
|
|
|
layout.operator("surface.primitive_nurbs_surface_cylinder_add", icon='SURFACE_NCYLINDER', text="NURBS Cylinder")
|
|
|
|
layout.operator("surface.primitive_nurbs_surface_sphere_add", icon='SURFACE_NSPHERE', text="NURBS Sphere")
|
|
|
|
layout.operator("surface.primitive_nurbs_surface_torus_add", icon='SURFACE_NTORUS', text="NURBS Torus")
|
2010-06-09 19:12:03 +00:00
|
|
|
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_armature_add(Menu):
|
2009-12-11 14:16:59 +00:00
|
|
|
bl_idname = "INFO_MT_armature_add"
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Armature"
|
2009-12-11 14:16:59 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2011-08-22 09:01:49 +00:00
|
|
|
|
2009-12-11 14:16:59 +00:00
|
|
|
layout.operator_context = 'INVOKE_REGION_WIN'
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("object.armature_add", text="Single Bone", icon='BONE_DATA')
|
2009-12-11 14:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_add(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Add"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2012-02-08 04:37:37 +00:00
|
|
|
# note, don't use 'EXEC_SCREEN' or operators wont get the 'v3d' context.
|
2012-01-13 10:14:48 +00:00
|
|
|
|
|
|
|
layout.operator_context = 'EXEC_AREA'
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
#layout.operator_menu_enum("object.mesh_add", "type", text="Mesh", icon='OUTLINER_OB_MESH')
|
2009-12-10 10:23:53 +00:00
|
|
|
layout.menu("INFO_MT_mesh_add", icon='OUTLINER_OB_MESH')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
#layout.operator_menu_enum("object.curve_add", "type", text="Curve", icon='OUTLINER_OB_CURVE')
|
2010-05-23 02:02:04 +00:00
|
|
|
layout.menu("INFO_MT_curve_add", icon='OUTLINER_OB_CURVE')
|
2011-09-21 15:18:38 +00:00
|
|
|
#layout.operator_menu_enum("object.surface_add", "type", text="Surface", icon='OUTLINER_OB_SURFACE')
|
2010-06-13 05:48:21 +00:00
|
|
|
layout.menu("INFO_MT_surface_add", icon='OUTLINER_OB_SURFACE')
|
2011-09-21 15:18:38 +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'
|
2011-09-21 15:18:38 +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')
|
2011-09-21 15:18:38 +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
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER')
|
2011-08-03 09:25:40 +00:00
|
|
|
layout.separator()
|
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("object.camera_add", text="Camera", icon='OUTLINER_OB_CAMERA')
|
2012-01-13 10:14:48 +00:00
|
|
|
layout.operator_context = 'EXEC_AREA'
|
2011-09-21 15:18:38 +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
|
|
|
|
2011-09-21 15:18:38 +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'
|
2011-09-21 15:18: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:
|
2011-09-21 15:18:38 +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
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_game(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Game"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2010-08-18 08:26:18 +00:00
|
|
|
gs = context.scene.game_settings
|
2009-08-18 15:27:48 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("view3d.game_start")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-08-18 15:27:48 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(gs, "show_debug_properties")
|
|
|
|
layout.prop(gs, "show_framerate_profile")
|
|
|
|
layout.prop(gs, "show_physics_visualization")
|
2010-02-22 12:25:58 +00:00
|
|
|
layout.prop(gs, "use_deprecation_warnings")
|
|
|
|
layout.prop(gs, "use_animation_record")
|
2010-03-05 10:37:55 +00:00
|
|
|
layout.separator()
|
2010-08-20 06:09:58 +00:00
|
|
|
layout.prop(gs, "use_auto_start")
|
2009-08-18 15:27:48 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_render(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Render"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("render.render", text="Render Image", icon='RENDER_STILL')
|
|
|
|
layout.operator("render.render", text="Render Animation", icon='RENDER_ANIMATION').animation = True
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-28 18:03:04 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("render.opengl", text="OpenGL Render Image")
|
|
|
|
layout.operator("render.opengl", text="OpenGL Render Animation").animation = True
|
2009-10-28 18:03:04 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-03-08 16:36:53 +00:00
|
|
|
layout.operator("render.view_show")
|
|
|
|
layout.operator("render.play_rendered_anim")
|
2012-05-01 13:32:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
class INFO_MT_window(Menu):
|
2012-04-30 19:37:04 +00:00
|
|
|
bl_label = "Window"
|
2012-05-01 13:32:55 +00:00
|
|
|
|
2012-04-30 19:37:04 +00:00
|
|
|
def draw(self, context):
|
|
|
|
import sys
|
2012-05-01 13:32:55 +00:00
|
|
|
|
2012-04-30 19:37:04 +00:00
|
|
|
layout = self.layout
|
2012-05-01 13:32:55 +00:00
|
|
|
|
2012-04-30 19:37:04 +00:00
|
|
|
layout.operator("wm.window_duplicate")
|
|
|
|
layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER')
|
|
|
|
if sys.platform[:3] == "win":
|
|
|
|
layout.separator()
|
|
|
|
layout.operator("wm.console_toggle", icon='CONSOLE')
|
2012-05-01 13:32:55 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class INFO_MT_help(Menu):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Help"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2011-11-28 19:22:26 +00:00
|
|
|
layout.operator("wm.url_open", text="Manual", icon='HELP').url = 'http://wiki.blender.org/index.php/Doc:2.6/Manual'
|
2012-04-05 09:27:53 +00:00
|
|
|
layout.operator("wm.url_open", text="Release Log", icon='URL').url = 'http://www.blender.org/development/release-logs/blender-263/'
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2011-09-21 15:18:38 +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()
|
2011-09-21 15:18:38 +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()
|
2011-04-14 14:13:04 +00:00
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("wm.url_open", text="Python API Reference", icon='URL').url = bpy.types.WM_OT_doc_view._prefix
|
2011-09-22 19:50:41 +00:00
|
|
|
layout.operator("wm.operator_cheat_sheet", icon='TEXT')
|
2010-10-16 17:26:40 +00:00
|
|
|
layout.operator("wm.sysinfo", icon='TEXT')
|
2010-08-29 15:40:48 +00:00
|
|
|
layout.separator()
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.operator("anim.update_data_paths", text="FCurve/Driver Version fix", icon='HELP')
|
TexFace to Material Settings big patch
Summary:
========
The idea here is to move the texface options into the material panel.
For images with the change please visit:
http://code.blender.org/index.php/2011/09/bge-material-texface-changes
1 - Some of the legacy problems 2.49 and 2.5x has with the texface system:
==========================================================================
1.1) Shadow, Bilboard and Halo are mutual exclusive (in the code), yet you can
select a face to be more than one mode.
1.2) Sort only works for blend Alpha yet it's an option regardless of the
Transparency Blend you pick.
1.3) Shared doesn't affect anything in BGE.
1.4) ObColor only works for Text objects (old bitmap texts) when using Texture
Face Materials. (not address yet, I so far ignored obcolor)
2 - Notes:
============
2.1) Now "Use Face Textures" in material Option panel will work in Multitexture
even if there is no texture channel.
2.2) In FaceTexture mode it will use TexFace all the time, even if you don't
check the "Use Texture Face" option in the UI. It's a matter of decision, since
the code for either way is there. I decided by the solution that makes the
creation of a material fast - in this mode the user doesn't need to mess with
textures or this "Use Texture Face" option at all. I'm not strong in my opinion
here. But I think if we don't have this then what is the point of the Texture
Face mode?
2.3) I kept references for tface only when we need the image, UV or the tiling
setting. It should help later when/if we split the Image and UV layers from the
tface struct (Campbell and Brecht proposal).
3 - Changes in a Nutshell:
==========================
3.1) "Texture Face" panel (in the Mesh/Object Data panel) no longer exists. Those settings are all part of the material properties, visible when Game Render is set.
3.2) "Texture Face" Shading mode (in the Render panel) is now called “Single Texture”, it needs a material for special settings (e.g. Billboard, Alpha Sort, …).
3.3) New options in the Material Panel
* Shadeless option in the Material panel is now supported for all three Shading modes.
* Physics is now toggleable, this is the old Collision option.
* Two Side (on) is now called Back Culling (off).
* Alpha Sort is one of the Alpha options, together (and mutually exclusive) to Alpha Blend, Alpha Clip, Add and Opaque (i.e. solid).
* Shadow, Billboard and Halo are grouped in the “Face Orientation” property.
* "Face Textures" and "Face Textures Alpha" (under Options) can be used for all but GLSL shading mode (to be supported in GLSL eventually).
* The backend in the game engine is still the same as before. The only changes are in the interface and in the way you need to think your materials. The bottomline is: It’s no longer possible to share materials between faces that do not share the same game properties.
4 - Acknowledgment:
==================
Mike Pan for the design discussions, and testing along the whole development process.
Vitor Balbio for the first hands-on code with the interface changes. That helped me a lot to push me into work on that.
Benoit Bolsee and Brecht van Lommel for patch review (* no one reviewed the whole patch, or the latest iteractions, so I still hold liability for any problems).
Blender artists that gave feedback and helped testing the patch.
Patch review and original documentation can be found here:
http://wiki.blender.org/index.php/User:Dfelinto/TexFace
http://codereview.appspot.com/4289041/
2011-09-19 19:55:59 +00:00
|
|
|
layout.operator("logic.texface_convert", text="TexFace to Material Convert", icon='GAME')
|
2010-03-29 08:27:04 +00:00
|
|
|
layout.separator()
|
2012-05-01 13:32:55 +00:00
|
|
|
|
2011-02-27 17:11:56 +00:00
|
|
|
layout.operator("wm.splash", icon='BLENDER')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
bpy.utils.register_module(__name__)
|