2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
import bpy
|
|
|
|
|
|
|
|
class INFO_HT_header(bpy.types.Header):
|
2009-08-18 12:58:51 +00:00
|
|
|
__space_type__ = "INFO"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
2009-08-11 18:19:09 +00:00
|
|
|
layout = self.layout
|
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
st = context.space_data
|
2009-08-19 12:35:40 +00:00
|
|
|
scene = context.scene
|
|
|
|
rd = scene.render_data
|
2009-08-19 00:55:30 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.template_header()
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
if context.area.show_menus:
|
2009-08-19 00:55:30 +00:00
|
|
|
sub = row.row(align=True)
|
|
|
|
sub.itemM("INFO_MT_file")
|
|
|
|
sub.itemM("INFO_MT_add")
|
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
|
|
|
if rd.use_game_engine:
|
2009-08-19 00:55:30 +00:00
|
|
|
sub.itemM("INFO_MT_game")
|
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
|
|
|
else:
|
2009-08-19 00:55:30 +00:00
|
|
|
sub.itemM("INFO_MT_render")
|
|
|
|
sub.itemM("INFO_MT_help")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-08-15 16:43:03 +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")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
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
|
|
|
if rd.multiple_engines:
|
|
|
|
layout.itemR(rd, "engine", text="")
|
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
layout.template_operator_search()
|
|
|
|
layout.template_running_jobs()
|
2009-08-19 12:35:40 +00:00
|
|
|
|
|
|
|
layout.itemL(text=scene.statistics())
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
class INFO_MT_file(bpy.types.Menu):
|
2009-08-18 12:58:51 +00:00
|
|
|
__space_type__ = "INFO"
|
2009-06-30 19:20:45 +00:00
|
|
|
__label__ = "File"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.operator_context = "EXEC_AREA"
|
2009-07-23 21:35:11 +00:00
|
|
|
layout.itemO("wm.read_homefile", text="New")
|
2009-06-30 19:20:45 +00:00
|
|
|
layout.operator_context = "INVOKE_AREA"
|
2009-07-23 21:35:11 +00:00
|
|
|
layout.itemO("wm.open_mainfile", text="Open...")
|
|
|
|
layout.item_menu_enumO("wm.open_recentfile", "file", text="Open Recent")
|
|
|
|
layout.itemO("wm.recover_last_session")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
layout.operator_context = "EXEC_AREA"
|
2009-07-23 21:35:11 +00:00
|
|
|
layout.itemO("wm.save_mainfile", text="Save")
|
2009-06-30 19:20:45 +00:00
|
|
|
layout.operator_context = "INVOKE_AREA"
|
2009-07-23 21:35:11 +00:00
|
|
|
layout.itemO("wm.save_as_mainfile", text="Save As...")
|
2009-07-24 12:45:25 +00:00
|
|
|
layout.itemO("screen.userpref_show", text="User Preferences...")
|
2009-07-23 21:35:11 +00:00
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
layout.itemM("INFO_MT_file_import")
|
|
|
|
layout.itemM("INFO_MT_file_export")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
layout.itemM("INFO_MT_file_external_data")
|
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
layout.operator_context = "EXEC_AREA"
|
|
|
|
layout.itemO("wm.exit_blender", text="Quit")
|
|
|
|
|
|
|
|
class INFO_MT_file_import(bpy.types.Menu):
|
2009-08-18 12:58:51 +00:00
|
|
|
__space_type__ = "INFO"
|
2009-07-23 21:35:11 +00:00
|
|
|
__label__ = "Import"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
class INFO_MT_file_export(bpy.types.Menu):
|
2009-08-18 12:58:51 +00:00
|
|
|
__space_type__ = "INFO"
|
2009-07-23 21:35:11 +00:00
|
|
|
__label__ = "Export"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.itemO("export.ply", text="PLY")
|
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
class INFO_MT_file_external_data(bpy.types.Menu):
|
2009-08-18 12:58:51 +00:00
|
|
|
__space_type__ = "INFO"
|
2009-06-30 19:20:45 +00:00
|
|
|
__label__ = "External Data"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2009-07-17 12:26:40 +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
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
2009-07-17 12:26:40 +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
|
|
|
|
|
|
|
class INFO_MT_add(bpy.types.Menu):
|
2009-08-18 12:58:51 +00:00
|
|
|
__space_type__ = "INFO"
|
2009-06-30 19:20:45 +00:00
|
|
|
__label__ = "Add"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
layout.operator_context = "EXEC_SCREEN"
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-08-06 13:15:23 +00:00
|
|
|
layout.item_menu_enumO( "OBJECT_OT_mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
|
|
|
|
layout.item_menu_enumO( "OBJECT_OT_curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
|
|
|
|
layout.item_menu_enumO( "OBJECT_OT_surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
|
|
|
|
layout.item_menu_enumO( "OBJECT_OT_metaball_add", "type", 'META', icon='ICON_OUTLINER_OB_META')
|
|
|
|
layout.itemO("OBJECT_OT_text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
2009-08-06 13:15:23 +00:00
|
|
|
layout.itemO("OBJECT_OT_armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
|
|
|
|
layout.item_enumO("OBJECT_OT_object_add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE')
|
|
|
|
layout.item_enumO("OBJECT_OT_object_add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY')
|
2009-07-23 21:35:11 +00:00
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
2009-08-06 13:15:23 +00:00
|
|
|
layout.item_enumO("OBJECT_OT_object_add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA')
|
|
|
|
layout.item_enumO("OBJECT_OT_object_add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP')
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
class INFO_MT_game(bpy.types.Menu):
|
2009-08-18 12:58:51 +00:00
|
|
|
__space_type__ = "INFO"
|
2009-06-30 19:20:45 +00:00
|
|
|
__label__ = "Game"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-23 21:35:11 +00:00
|
|
|
|
2009-08-18 15:27:48 +00:00
|
|
|
gs = context.scene.game_data
|
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
layout.itemO("view3d.game_start")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
2009-08-18 15:27:48 +00:00
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
layout.itemR(gs, "show_debug_properties")
|
|
|
|
layout.itemR(gs, "show_framerate_profile")
|
|
|
|
layout.itemR(gs, "show_physics_visualization")
|
|
|
|
layout.itemR(gs, "deprecation_warnings")
|
|
|
|
|
2009-06-30 19:20:45 +00:00
|
|
|
class INFO_MT_render(bpy.types.Menu):
|
2009-08-18 12:58:51 +00:00
|
|
|
__space_type__ = "INFO"
|
2009-06-30 19:20:45 +00:00
|
|
|
__label__ = "Render"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-08-11 18:19:09 +00:00
|
|
|
|
2009-07-23 21:35:11 +00:00
|
|
|
rd = context.scene.render_data
|
|
|
|
|
|
|
|
layout.itemO("screen.render", text="Render Image")
|
|
|
|
layout.item_booleanO("screen.render", "animation", True, text="Render Animation")
|
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
layout.itemO("screen.render_view_show")
|
2009-06-30 19:20:45 +00:00
|
|
|
|
|
|
|
class INFO_MT_help(bpy.types.Menu):
|
2009-08-18 12:58:51 +00:00
|
|
|
__space_type__ = "INFO"
|
2009-06-30 19:20:45 +00:00
|
|
|
__label__ = "Help"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-07-23 21:35:11 +00:00
|
|
|
|
|
|
|
layout.itemO("help.manual")
|
|
|
|
layout.itemO("help.release_logs")
|
|
|
|
|
|
|
|
layout.itemS()
|
|
|
|
|
|
|
|
layout.itemO("help.blender_website")
|
|
|
|
layout.itemO("help.blender_eshop")
|
|
|
|
layout.itemO("help.developer_community")
|
|
|
|
layout.itemO("help.user_community")
|
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)
|
|
|
|
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
|
|
|
|
|
|
|
|
import bpy_ops # XXX - should not need to do this
|
|
|
|
del bpy_ops
|
|
|
|
|
|
|
|
class HelpOperator(bpy.types.Operator):
|
|
|
|
def execute(self, context):
|
|
|
|
try: import webbrowser
|
|
|
|
except: webbrowser = None
|
|
|
|
|
|
|
|
if webbrowser:
|
|
|
|
webbrowser.open(self.__URL__)
|
|
|
|
else:
|
|
|
|
raise Exception("Operator requires a full Python installation")
|
|
|
|
|
|
|
|
return ('FINISHED',)
|
|
|
|
|
|
|
|
class HELP_OT_manual(HelpOperator):
|
|
|
|
__idname__ = "help.manual"
|
|
|
|
__label__ = "Manual"
|
|
|
|
__URL__ = 'http://wiki.blender.org/index.php/Manual'
|
|
|
|
|
|
|
|
class HELP_OT_release_logs(HelpOperator):
|
|
|
|
__idname__ = "help.release_logs"
|
|
|
|
__label__ = "Release Logs"
|
|
|
|
__URL__ = 'http://www.blender.org/development/release-logs/'
|
|
|
|
|
|
|
|
class HELP_OT_blender_website(HelpOperator):
|
|
|
|
__idname__ = "help.blender_website"
|
|
|
|
__label__ = "Blender Website"
|
|
|
|
__URL__ = 'http://www.blender.org/'
|
|
|
|
|
|
|
|
class HELP_OT_blender_eshop(HelpOperator):
|
|
|
|
__idname__ = "help.blender_eshop"
|
|
|
|
__label__ = "Blender e-Shop"
|
|
|
|
__URL__ = 'http://www.blender3d.org/e-shop'
|
|
|
|
|
|
|
|
class HELP_OT_developer_community(HelpOperator):
|
|
|
|
__idname__ = "help.developer_community"
|
|
|
|
__label__ = "Developer Community"
|
|
|
|
__URL__ = 'http://www.blender.org/community/get-involved/'
|
|
|
|
|
|
|
|
class HELP_OT_user_community(HelpOperator):
|
|
|
|
__idname__ = "help.user_community"
|
|
|
|
__label__ = "User Community"
|
|
|
|
__URL__ = 'http://www.blender.org/community/user-community/'
|
|
|
|
|
|
|
|
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-08-18 12:58:51 +00:00
|
|
|
|