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):
43 def draw(self, context):
46 layout.operator_context = "EXEC_AREA"
47 layout.itemO("wm.read_homefile", text="New")
48 layout.operator_context = "INVOKE_AREA"
49 layout.itemO("wm.open_mainfile", text="Open...")
50 layout.item_menu_enumO("wm.open_recentfile", "file", text="Open Recent")
51 layout.itemO("wm.recover_last_session")
55 layout.operator_context = "EXEC_AREA"
56 layout.itemO("wm.save_mainfile", text="Save")
57 layout.operator_context = "INVOKE_AREA"
58 layout.itemO("wm.save_as_mainfile", text="Save As...")
59 layout.itemO("screen.userpref_show", text="User Preferences...")
62 layout.operator_context = "INVOKE_AREA"
63 layout.itemO("wm.link_append", text="Link")
64 layout.item_booleanO("wm.link_append", "link", False, text="Append")
67 layout.itemM("INFO_MT_file_import")
68 layout.itemM("INFO_MT_file_export")
72 layout.itemM("INFO_MT_file_external_data")
76 layout.operator_context = "EXEC_AREA"
77 layout.itemO("wm.exit_blender", text="Quit")
79 class INFO_MT_file_import(bpy.types.Menu):
82 def draw(self, context):
85 layout.itemO("import.3ds", text="3DS")
86 layout.itemO("import.obj", text="OBJ")
89 class INFO_MT_file_export(bpy.types.Menu):
92 def draw(self, context):
95 layout.itemO("export.3ds", text="3DS")
96 layout.itemO("export.fbx", text="FBX")
97 layout.itemO("export.obj", text="OBJ")
98 layout.itemO("export.mdd", text="MDD")
99 layout.itemO("export.ply", text="PLY")
100 layout.itemO("export.x3d", text="X3D")
103 class INFO_MT_file_external_data(bpy.types.Menu):
104 __label__ = "External Data"
106 def draw(self, context):
109 layout.itemO("file.pack_all", text="Pack into .blend file")
110 layout.itemO("file.unpack_all", text="Unpack into Files...")
114 layout.itemO("file.make_paths_relative")
115 layout.itemO("file.make_paths_absolute")
116 layout.itemO("file.report_missing_files")
117 layout.itemO("file.find_missing_files")
119 class INFO_MT_add(bpy.types.Menu):
122 def draw(self, context):
125 layout.operator_context = "EXEC_SCREEN"
127 layout.item_menu_enumO("object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
128 layout.item_menu_enumO("object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
129 layout.item_menu_enumO("object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
130 layout.item_menu_enumO("object.metaball_add", "type", 'META', text="Metaball", icon='ICON_OUTLINER_OB_META')
131 layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
135 layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
136 layout.item_enumO("object.add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE')
137 layout.item_enumO("object.add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY')
141 layout.item_enumO("object.add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA')
142 layout.item_menu_enumO("object.lamp_add", "type", 'LAMP', text="Lamp", icon='ICON_OUTLINER_OB_LAMP')
146 layout.item_menu_enumO("object.effector_add", "type", 'EMPTY', text="Force Field", icon='ICON_OUTLINER_OB_EMPTY')
148 class INFO_MT_game(bpy.types.Menu):
151 def draw(self, context):
154 gs = context.scene.game_data
156 layout.itemO("view3d.game_start")
160 layout.itemR(gs, "show_debug_properties")
161 layout.itemR(gs, "show_framerate_profile")
162 layout.itemR(gs, "show_physics_visualization")
163 layout.itemR(gs, "deprecation_warnings")
165 class INFO_MT_render(bpy.types.Menu):
168 def draw(self, context):
171 rd = context.scene.render_data
173 layout.itemO("screen.render", text="Render Image")
174 layout.item_booleanO("screen.render", "animation", True, text="Render Animation")
178 layout.itemO("screen.render_view_show")
180 class INFO_MT_help(bpy.types.Menu):
183 def draw(self, context):
186 layout.itemO("help.manual")
187 layout.itemO("help.release_logs")
191 layout.itemO("help.blender_website")
192 layout.itemO("help.blender_eshop")
193 layout.itemO("help.developer_community")
194 layout.itemO("help.user_community")
196 layout.itemO("help.operator_cheat_sheet")
199 bpy.types.register(INFO_HT_header)
200 bpy.types.register(INFO_MT_file)
201 bpy.types.register(INFO_MT_file_import)
202 bpy.types.register(INFO_MT_file_export)
203 bpy.types.register(INFO_MT_file_external_data)
204 bpy.types.register(INFO_MT_add)
205 bpy.types.register(INFO_MT_game)
206 bpy.types.register(INFO_MT_render)
207 bpy.types.register(INFO_MT_help)
211 class HelpOperator(bpy.types.Operator):
212 def execute(self, context):
213 try: import webbrowser
214 except: webbrowser = None
217 webbrowser.open(self.__URL__)
219 raise Exception("Operator requires a full Python installation")
223 class HELP_OT_manual(HelpOperator):
224 __idname__ = "help.manual"
226 __URL__ = 'http://wiki.blender.org/index.php/Manual'
228 class HELP_OT_release_logs(HelpOperator):
229 __idname__ = "help.release_logs"
230 __label__ = "Release Logs"
231 __URL__ = 'http://www.blender.org/development/release-logs/'
233 class HELP_OT_blender_website(HelpOperator):
234 __idname__ = "help.blender_website"
235 __label__ = "Blender Website"
236 __URL__ = 'http://www.blender.org/'
238 class HELP_OT_blender_eshop(HelpOperator):
239 __idname__ = "help.blender_eshop"
240 __label__ = "Blender e-Shop"
241 __URL__ = 'http://www.blender3d.org/e-shop'
243 class HELP_OT_developer_community(HelpOperator):
244 __idname__ = "help.developer_community"
245 __label__ = "Developer Community"
246 __URL__ = 'http://www.blender.org/community/get-involved/'
248 class HELP_OT_user_community(HelpOperator):
249 __idname__ = "help.user_community"
250 __label__ = "User Community"
251 __URL__ = 'http://www.blender.org/community/user-community/'
253 class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
254 __idname__ = "help.operator_cheat_sheet"
255 __label__ = "Operator Cheet Sheet (new textblock)"
256 def execute(self, context):
259 for op_module_name in dir(bpy.ops):
260 op_module = getattr(bpy.ops, op_module_name)
261 for op_submodule_name in dir(op_module):
262 op = getattr(op_module, op_submodule_name)
264 if text.startswith('bpy.ops.'):
265 op_strings.append(text)
268 op_strings.append('')
270 bpy.ops.text.new() # XXX - assumes new text is always at the end!
271 textblock = bpy.data.texts[-1]
272 textblock.write('# %d Operators\n\n' % tot)
273 textblock.write('\n'.join(op_strings))
274 textblock.name = "OperatorList.txt"
275 print("See OperatorList.txt textblock")
279 bpy.ops.add(HELP_OT_manual)
280 bpy.ops.add(HELP_OT_release_logs)
281 bpy.ops.add(HELP_OT_blender_website)
282 bpy.ops.add(HELP_OT_blender_eshop)
283 bpy.ops.add(HELP_OT_developer_community)
284 bpy.ops.add(HELP_OT_user_community)
285 bpy.ops.add(HELP_OT_operator_cheat_sheet)