Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_operators/wm.py
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| self.actions.add() | self.actions.add() | ||||
| wm = context.window_manager | wm = context.window_manager | ||||
| return wm.invoke_props_dialog(self, width=400) | return wm.invoke_props_dialog(self, width=400) | ||||
| class WM_MT_splash(Menu): | class WM_MT_splash(Menu): | ||||
| bl_label = "Splash" | bl_label = "Splash" | ||||
| def draw_setup(self, context): | def draw(self, context): | ||||
| layout = self.layout | |||||
| layout.operator_context = 'EXEC_DEFAULT' | |||||
| layout.emboss = 'PULLDOWN_MENU' | |||||
| split = layout.split() | |||||
| # Templates | |||||
| col1 = split.column() | |||||
| col1.label(text="New File") | |||||
| bpy.types.TOPBAR_MT_file_new.draw_ex(col1, context, use_splash=True) | |||||
| # Recent | |||||
| col2 = split.column() | |||||
| col2_title = col2.row() | |||||
| found_recent = col2.template_recent_files() | |||||
| if found_recent: | |||||
| col2_title.label(text="Recent Files") | |||||
| else: | |||||
| # Links if no recent files | |||||
| col2_title.label(text="Getting Started") | |||||
| col2.operator("wm.url_open_preset", text="Manual", icon='URL').type = 'MANUAL' | |||||
| col2.operator("wm.url_open_preset", text="Blender Website", icon='URL').type = 'BLENDER' | |||||
| col2.operator("wm.url_open_preset", text="Credits", icon='URL').type = 'CREDITS' | |||||
| layout.separator() | |||||
| split = layout.split() | |||||
| col1 = split.column() | |||||
| sub = col1.row() | |||||
| sub.operator_context = 'INVOKE_DEFAULT' | |||||
| sub.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER') | |||||
| col1.operator("wm.recover_last_session", icon='RECOVER_LAST') | |||||
| col2 = split.column() | |||||
| col2.operator("wm.url_open_preset", text="Release Notes", icon='URL').type = 'RELEASE_NOTES' | |||||
| col2.operator("wm.url_open_preset", text="Development Fund", icon='FUND').type = 'FUND' | |||||
| layout.separator() | |||||
| layout.separator() | |||||
| class WM_MT_splash_quick_setup(Menu): | |||||
| bl_label = "Quick Setup" | |||||
| def draw(self, context): | |||||
| wm = context.window_manager | wm = context.window_manager | ||||
| # prefs = context.preferences | # prefs = context.preferences | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.operator_context = 'EXEC_DEFAULT' | layout.operator_context = 'EXEC_DEFAULT' | ||||
| layout.label(text="Quick Setup") | layout.label(text="Quick Setup") | ||||
| ▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
| else: | else: | ||||
| sub.label() | sub.label() | ||||
| sub.label() | sub.label() | ||||
| sub.operator("wm.save_userpref", text="Next") | sub.operator("wm.save_userpref", text="Next") | ||||
| layout.separator() | layout.separator() | ||||
| layout.separator() | layout.separator() | ||||
| def draw(self, context): | |||||
| # Draw setup screen if no preferences have been saved yet. | |||||
| import os | |||||
| userconfig_path = bpy.utils.user_resource('CONFIG') | |||||
| userdef_path = os.path.join(userconfig_path, "userpref.blend") | |||||
| if not os.path.isfile(userdef_path): | |||||
| self.draw_setup(context) | |||||
| return | |||||
| # Pass | |||||
| layout = self.layout | |||||
| layout.operator_context = 'EXEC_DEFAULT' | |||||
| layout.emboss = 'PULLDOWN_MENU' | |||||
| split = layout.split() | |||||
| # Templates | |||||
| col1 = split.column() | |||||
| col1.label(text="New File") | |||||
| bpy.types.TOPBAR_MT_file_new.draw_ex(col1, context, use_splash=True) | |||||
| # Recent | |||||
| col2 = split.column() | |||||
| col2_title = col2.row() | |||||
| found_recent = col2.template_recent_files() | |||||
| if found_recent: | |||||
| col2_title.label(text="Recent Files") | |||||
| else: | |||||
| # Links if no recent files | |||||
| col2_title.label(text="Getting Started") | |||||
| col2.operator("wm.url_open_preset", text="Manual", icon='URL').type = 'MANUAL' | |||||
| col2.operator("wm.url_open_preset", text="Blender Website", icon='URL').type = 'BLENDER' | |||||
| col2.operator("wm.url_open_preset", text="Credits", icon='URL').type = 'CREDITS' | |||||
| layout.separator() | |||||
| split = layout.split() | |||||
| col1 = split.column() | |||||
| sub = col1.row() | |||||
| sub.operator_context = 'INVOKE_DEFAULT' | |||||
| sub.operator("wm.open_mainfile", text="Open...", icon='FILE_FOLDER') | |||||
| col1.operator("wm.recover_last_session", icon='RECOVER_LAST') | |||||
| col2 = split.column() | |||||
| col2.operator("wm.url_open_preset", text="Release Notes", icon='URL').type = 'RELEASE_NOTES' | |||||
| col2.operator("wm.url_open_preset", text="Development Fund", icon='FUND').type = 'FUND' | |||||
| layout.separator() | |||||
| layout.separator() | |||||
| class WM_MT_splash_about(Menu): | class WM_MT_splash_about(Menu): | ||||
| bl_label = "About" | bl_label = "About" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.operator_context = 'EXEC_DEFAULT' | layout.operator_context = 'EXEC_DEFAULT' | ||||
| ▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | |||||
| WM_OT_tool_set_by_id, | WM_OT_tool_set_by_id, | ||||
| WM_OT_tool_set_by_index, | WM_OT_tool_set_by_index, | ||||
| WM_OT_toolbar, | WM_OT_toolbar, | ||||
| WM_OT_toolbar_fallback_pie, | WM_OT_toolbar_fallback_pie, | ||||
| WM_OT_toolbar_prompt, | WM_OT_toolbar_prompt, | ||||
| BatchRenameAction, | BatchRenameAction, | ||||
| WM_OT_batch_rename, | WM_OT_batch_rename, | ||||
| WM_MT_splash, | WM_MT_splash, | ||||
| WM_MT_splash_quick_setup, | |||||
| WM_MT_splash_about, | WM_MT_splash_about, | ||||
| ) | ) | ||||
| Context not available. | |||||