[Bf-blender-cvs] [b2b00cb8eaa] blender-projects-basics: Improve message in Project Settings when there's no project + cleanup
Julian Eisel
noreply at git.blender.org
Fri Oct 7 11:56:21 CEST 2022
Commit: b2b00cb8eaa5ec6633d3bece599d29a7e0e9e86b
Author: Julian Eisel
Date: Fri Oct 7 11:55:23 2022 +0200
Branches: blender-projects-basics
https://developer.blender.org/rBb2b00cb8eaa5ec6633d3bece599d29a7e0e9e86b
Improve message in Project Settings when there's no project + cleanup
Also show a button to set up a project.
===================================================================
M release/scripts/startup/bl_ui/space_project_settings.py
M source/blender/windowmanager/intern/wm_files.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_project_settings.py b/release/scripts/startup/bl_ui/space_project_settings.py
index 899218acf87..73f118a16ee 100644
--- a/release/scripts/startup/bl_ui/space_project_settings.py
+++ b/release/scripts/startup/bl_ui/space_project_settings.py
@@ -113,7 +113,7 @@ class PROJECTSETTINGS_PT_save_project_settings(Panel):
PROJECTSETTINGS_HT_header.draw_buttons(layout, context)
-class PROJECTSETTINGS_PT_no_project(CenterAlignMixIn, Panel):
+class PROJECTSETTINGS_PT_no_project(Panel):
bl_space_type = 'PROJECT_SETTINGS'
bl_region_type = 'WINDOW'
# Special hardcoded context.
@@ -125,10 +125,17 @@ class PROJECTSETTINGS_PT_no_project(CenterAlignMixIn, Panel):
def poll(cls, context):
return (context.project is None)
- def draw_centered(self, context, layout):
+ def draw(self, context):
layout = self.layout
layout.label(text="No active project.", icon='INFO')
+ col = layout.column(align=True)
+ col.label(text="Open/store a file inside of a project directory, or set up a new project")
+ col.label(text="by choosing a project directory.")
+
+ row = layout.row()
+ split = row.split(factor=0.3)
+ split.operator("wm.new_project", text="Set up Project...")
class PROJECTSETTINGS_PT_setup(CenterAlignMixIn, Panel):
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 73a4a1bd88a..a8e39c425f2 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -2359,7 +2359,6 @@ static bool wm_project_has_active_poll(bContext *C)
return active_project != NULL;
}
-/* Only save the prefs block. operator entry */
static int wm_save_project_settings_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
{
BlenderProject *active_project = CTX_wm_project();
@@ -2487,7 +2486,7 @@ void WM_OT_delete_project_setup(wmOperatorType *ot)
ot->idname = "WM_OT_delete_project_setup";
ot->description =
"Remove the configuration of the current project with all settings, but keep project files "
- "(such as .blend files) untouched.";
+ "(such as .blend files) untouched";
ot->invoke = WM_operator_confirm;
ot->exec = wm_delete_project_setup_exec;
More information about the Bf-blender-cvs
mailing list