4 class INFO_HT_header(bpy.types.Header):
5 __space_type__ = 'INFO'
7 def draw(self, context):
10 st = context.space_data
12 rd = scene.render_data
14 row = layout.row(align=True)
17 if context.area.show_menus:
18 sub = row.row(align=True)
19 sub.itemM("INFO_MT_file")
20 sub.itemM("INFO_MT_add")
21 if rd.use_game_engine:
22 sub.itemM("INFO_MT_game")
24 sub.itemM("INFO_MT_render")
25 sub.itemM("INFO_MT_help")
27 layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
28 layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete")
30 if rd.multiple_engines:
31 layout.itemR(rd, "engine", text="")
35 layout.template_operator_search()
36 layout.template_running_jobs()
38 layout.itemL(text=scene.statistics())
40 class INFO_MT_file(bpy.types.Menu):
41 __space_type__ = 'INFO'
44 def draw(self, context):
47 layout.operator_context = "EXEC_AREA"
48 layout.itemO("wm.read_homefile", text="New")
49 layout.operator_context = "INVOKE_AREA"
50 layout.itemO("wm.open_mainfile", text="Open...")
51 layout.item_menu_enumO("wm.open_recentfile", "file", text="Open Recent")
52 layout.itemO("wm.recover_last_session")
56 layout.operator_context = "EXEC_AREA"
57 layout.itemO("wm.save_mainfile", text="Save")
58 layout.operator_context = "INVOKE_AREA"
59 layout.itemO("wm.save_as_mainfile", text="Save As...")
60 layout.itemO("screen.userpref_show", text="User Preferences...")
63 layout.operator_context = "INVOKE_AREA"
64 layout.itemO("wm.link_append", text="Link")
65 layout.item_booleanO("wm.link_append", "link", False, text="Append")
68 layout.itemM("INFO_MT_file_import")
69 layout.itemM("INFO_MT_file_export")
73 layout.itemM("INFO_MT_file_external_data")
77 layout.operator_context = "EXEC_AREA"
78 layout.itemO("wm.exit_blender", text="Quit")
80 class INFO_MT_file_import(bpy.types.Menu):
81 __space_type__ = 'INFO'
84 def draw(self, context):
87 layout.itemO("import.3ds", text="3DS")
88 layout.itemO("import.obj", text="OBJ")
91 class INFO_MT_file_export(bpy.types.Menu):
92 __space_type__ = 'INFO'
95 def draw(self, context):
98 layout.itemO("export.3ds", text="3DS")
99 layout.itemO("export.fbx", text="FBX")
100 layout.itemO("export.obj", text="OBJ")
101 layout.itemO("export.mdd", text="MDD")
102 layout.itemO("export.ply", text="PLY")
103 layout.itemO("export.x3d", text="X3D")
106 class INFO_MT_file_external_data(bpy.types.Menu):
107 __space_type__ = 'INFO'
108 __label__ = "External Data"
110 def draw(self, context):
113 layout.itemO("file.pack_all", text="Pack into .blend file")
114 layout.itemO("file.unpack_all", text="Unpack into Files...")
118 layout.itemO("file.make_paths_relative")
119 layout.itemO("file.make_paths_absolute")
120 layout.itemO("file.report_missing_files")
121 layout.itemO("file.find_missing_files")
123 class INFO_MT_add(bpy.types.Menu):
124 __space_type__ = 'INFO'
127 def draw(self, context):
130 layout.operator_context = "EXEC_SCREEN"
132 layout.item_menu_enumO("object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
133 layout.item_menu_enumO("object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
134 layout.item_menu_enumO("object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
135 layout.item_menu_enumO("object.metaball_add", "type", 'META', text="Metaball", icon='ICON_OUTLINER_OB_META')
136 layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
140 layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
141 layout.item_enumO("object.add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE')
142 layout.item_enumO("object.add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY')
146 layout.item_enumO("object.add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA')
147 layout.item_menu_enumO("object.lamp_add", "type", 'LAMP', text="Lamp", icon='ICON_OUTLINER_OB_LAMP')
151 layout.item_menu_enumO("object.effector_add", "type", 'EMPTY', text="Force Field", icon='ICON_OUTLINER_OB_EMPTY')
153 class INFO_MT_game(bpy.types.Menu):
154 __space_type__ = 'INFO'
157 def draw(self, context):
160 gs = context.scene.game_data
162 layout.itemO("view3d.game_start")
166 layout.itemR(gs, "show_debug_properties")
167 layout.itemR(gs, "show_framerate_profile")
168 layout.itemR(gs, "show_physics_visualization")
169 layout.itemR(gs, "deprecation_warnings")
171 class INFO_MT_render(bpy.types.Menu):
172 __space_type__ = 'INFO'
175 def draw(self, context):
178 rd = context.scene.render_data
180 layout.itemO("screen.render", text="Render Image")
181 layout.item_booleanO("screen.render", "animation", True, text="Render Animation")
185 layout.itemO("screen.render_view_show")
187 class INFO_MT_help(bpy.types.Menu):
188 __space_type__ = 'INFO'
191 def draw(self, context):
194 layout.itemO("help.manual")
195 layout.itemO("help.release_logs")
199 layout.itemO("help.blender_website")
200 layout.itemO("help.blender_eshop")
201 layout.itemO("help.developer_community")
202 layout.itemO("help.user_community")
204 layout.itemO("help.operator_cheat_sheet")
207 bpy.types.register(INFO_HT_header)
208 bpy.types.register(INFO_MT_file)
209 bpy.types.register(INFO_MT_file_import)
210 bpy.types.register(INFO_MT_file_export)
211 bpy.types.register(INFO_MT_file_external_data)
212 bpy.types.register(INFO_MT_add)
213 bpy.types.register(INFO_MT_game)
214 bpy.types.register(INFO_MT_render)
215 bpy.types.register(INFO_MT_help)
219 class HelpOperator(bpy.types.Operator):
220 def execute(self, context):
221 try: import webbrowser
222 except: webbrowser = None
225 webbrowser.open(self.__URL__)
227 raise Exception("Operator requires a full Python installation")
231 class HELP_OT_manual(HelpOperator):
232 __idname__ = "help.manual"
234 __URL__ = 'http://wiki.blender.org/index.php/Manual'
236 class HELP_OT_release_logs(HelpOperator):
237 __idname__ = "help.release_logs"
238 __label__ = "Release Logs"
239 __URL__ = 'http://www.blender.org/development/release-logs/'
241 class HELP_OT_blender_website(HelpOperator):
242 __idname__ = "help.blender_website"
243 __label__ = "Blender Website"
244 __URL__ = 'http://www.blender.org/'
246 class HELP_OT_blender_eshop(HelpOperator):
247 __idname__ = "help.blender_eshop"
248 __label__ = "Blender e-Shop"
249 __URL__ = 'http://www.blender3d.org/e-shop'
251 class HELP_OT_developer_community(HelpOperator):
252 __idname__ = "help.developer_community"
253 __label__ = "Developer Community"
254 __URL__ = 'http://www.blender.org/community/get-involved/'
256 class HELP_OT_user_community(HelpOperator):
257 __idname__ = "help.user_community"
258 __label__ = "User Community"
259 __URL__ = 'http://www.blender.org/community/user-community/'
261 class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
262 __idname__ = "help.operator_cheat_sheet"
263 __label__ = "Operator Cheet Sheet (new textblock)"
264 def execute(self, context):
267 for op_module_name in dir(bpy.ops):
268 op_module = getattr(bpy.ops, op_module_name)
269 for op_submodule_name in dir(op_module):
270 op = getattr(op_module, op_submodule_name)
272 if text.startswith('bpy.ops.'):
273 op_strings.append(text)
276 op_strings.append('')
278 bpy.ops.text.new() # XXX - assumes new text is always at the end!
279 textblock = bpy.data.texts[-1]
280 textblock.write('# %d Operators\n\n' % tot)
281 textblock.write('\n'.join(op_strings))
282 textblock.name = "OperatorList.txt"
283 print("See OperatorList.txt textblock")
287 bpy.ops.add(HELP_OT_manual)
288 bpy.ops.add(HELP_OT_release_logs)
289 bpy.ops.add(HELP_OT_blender_website)
290 bpy.ops.add(HELP_OT_blender_eshop)
291 bpy.ops.add(HELP_OT_developer_community)
292 bpy.ops.add(HELP_OT_user_community)
293 bpy.ops.add(HELP_OT_operator_cheat_sheet)