[Bf-blender-cvs] [7f7c807a92e] master: Keep current app-template when selecting 'New File'

Campbell Barton noreply at git.blender.org
Fri Mar 31 13:05:21 CEST 2017


Commit: 7f7c807a92e35a1c34ced6749f88e62c2590ee89
Author: Campbell Barton
Date:   Fri Mar 31 22:06:36 2017 +1100
Branches: master
https://developer.blender.org/rB7f7c807a92e35a1c34ced6749f88e62c2590ee89

Keep current app-template when selecting 'New File'

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

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 2e799307cc0..b7703422aea 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -708,11 +708,18 @@ int wm_homefile_read(
 
 	/* load preferences before startup.blend */
 	if (!use_factory_settings && BLI_exists(filepath_userdef)) {
+
+		/* keep existing app-template for regular file-new */
+		char app_template_buf[sizeof(U.app_template)] = "";
+		BLI_strncpy(app_template_buf, U.app_template, sizeof(app_template_buf));
+
 		UserDef *userdef = BKE_blendfile_userdef_read(filepath_userdef, NULL);
 		if (userdef != NULL) {
 			BKE_blender_userdef_set_data(userdef);
 			MEM_freeN(userdef);
 
+			BLI_strncpy(U.app_template, app_template_buf, sizeof(app_template_buf));
+
 			read_userdef_from_memory = false;
 			skip_flags |= BLO_READ_SKIP_USERDEF;
 			printf("Read prefs: %s\n", filepath_userdef);




More information about the Bf-blender-cvs mailing list