[Bf-blender-cvs] [3bfa8d9] master: Fix py-driver in startup.blend crash in background mode

Campbell Barton noreply at git.blender.org
Fri Jul 15 07:37:18 CEST 2016


Commit: 3bfa8d9fd47936ad46e7030af7e4e0d9d4f1c35c
Author: Campbell Barton
Date:   Fri Jul 15 15:29:27 2016 +1000
Branches: master
https://developer.blender.org/rB3bfa8d9fd47936ad46e7030af7e4e0d9d4f1c35c

Fix py-driver in startup.blend crash in background mode

Obscure regression in own commit from b34929786.
While this could be considered correct, it introduces a crash so disable the update call.

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

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 729af73..fe257cc 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -482,8 +482,6 @@ static void wm_file_read_post(bContext *C, bool is_startup_file)
 		BPY_python_reset(C);
 		addons_loaded = true;
 	}
-#else
-	UNUSED_VARS(is_startup_file);
 #endif  /* WITH_PYTHON */
 
 	WM_operatortype_last_properties_clear_all();
@@ -492,8 +490,12 @@ static void wm_file_read_post(bContext *C, bool is_startup_file)
 	BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_VERSION_UPDATE);
 	BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
 
-	/* would otherwise be handled by event loop */
-	if (G.background) {
+	/* Would otherwise be handled by event loop.
+	 *
+	 * Disabled for startup file, since it causes problems when PyDrivers are used in the startup file.
+	 * While its possible state of startup file may be wrong,
+	 * in this case users nearly always load a file to replace the startup file. */
+	if (G.background && (is_startup_file == false)) {
 		Main *bmain = CTX_data_main(C);
 		BKE_scene_update_tagged(bmain->eval_ctx, bmain, CTX_data_scene(C));
 	}




More information about the Bf-blender-cvs mailing list