[Bf-blender-cvs] [0ee1cdab7e] master: WM: Option to load startup w/o closing the splash

Campbell Barton noreply at git.blender.org
Tue Mar 14 11:03:10 CET 2017


Commit: 0ee1cdab7e5896d56c7c6d9681a427e386fa2ae9
Author: Campbell Barton
Date:   Tue Mar 14 21:05:00 2017 +1100
Branches: master
https://developer.blender.org/rB0ee1cdab7e5896d56c7c6d9681a427e386fa2ae9

WM: Option to load startup w/o closing the splash

Not user visible, needed for switching templates.

===================================================================

M	source/blender/windowmanager/intern/wm_files.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 05d6386907..9e1a4e2e73 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1426,7 +1426,16 @@ static int wm_homefile_read_exec(bContext *C, wmOperator *op)
 		G.fileflags &= ~G_FILE_NO_UI;
 	}
 
-	return wm_homefile_read(C, op->reports, from_memory, filepath) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
+	if (wm_homefile_read(C, op->reports, from_memory, filepath)) {
+		/* Load a file but keep the splash open */
+		if (RNA_boolean_get(op->ptr, "use_splash")) {
+			WM_init_splash(C);
+		}
+		return OPERATOR_FINISHED;
+	}
+	else {
+		return OPERATOR_CANCELLED;
+	}
 }
 
 void WM_OT_read_homefile(wmOperatorType *ot)
@@ -1449,6 +1458,10 @@ void WM_OT_read_homefile(wmOperatorType *ot)
 	                       "Load user interface setup from the .blend file");
 	RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
 
+	/* So the splash can be kept open after loading a file (for templates). */
+	prop = RNA_def_boolean(ot->srna, "use_splash", true, "Splash", "");
+	RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
+
 	/* omit poll to run in background mode */
 }




More information about the Bf-blender-cvs mailing list