[Bf-blender-cvs] [d31b2f85495] master: Fix T61063, T62195: Python scripts should run before depsgraph evaluation.

Brecht Van Lommel noreply at git.blender.org
Tue Mar 5 19:23:09 CET 2019


Commit: d31b2f854954838fb849b5b0be0011d792eecb43
Author: Brecht Van Lommel
Date:   Tue Mar 5 19:17:36 2019 +0100
Branches: master
https://developer.blender.org/rBd31b2f854954838fb849b5b0be0011d792eecb43

Fix T61063, T62195: Python scripts should run before depsgraph evaluation.

This was changed (accidentally?) in d192d723123a, now go back to behavior more
similar to 2.7. Python scripts should be able to set up drivers or do other
changes that will then be taken into account when evaluating the scene for the
first time.

The more tricky thing is that Python scripts now run before ED_editors_init,
but given what happens in there it seems safe.

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

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 1354c3df6a5..aa66231a430 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -485,12 +485,6 @@ static void wm_file_read_post(
 
 	CTX_wm_window_set(C, wm->windows.first);
 
-	Main *bmain = CTX_data_main(C);
-	DEG_on_visible_update(bmain, true);
-	wm_event_do_depsgraph(C);
-
-	ED_editors_init(C);
-
 #ifdef WITH_PYTHON
 	if (is_startup_file) {
 		/* possible python hasn't been initialized */
@@ -520,6 +514,12 @@ static void wm_file_read_post(
 	UNUSED_VARS(is_startup_file, reset_app_template);
 #endif  /* WITH_PYTHON */
 
+	Main *bmain = CTX_data_main(C);
+	DEG_on_visible_update(bmain, true);
+	wm_event_do_depsgraph(C);
+
+	ED_editors_init(C);
+
 	WM_operatortype_last_properties_clear_all();
 
 	/* important to do before NULL'ing the context */



More information about the Bf-blender-cvs mailing list