[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55643] trunk/blender/source/blender/ windowmanager/intern/wm_init_exit.c: fix [#34636] bpy.app.handlers. load_post not run on startup file loading after splashscreen

Campbell Barton ideasman42 at gmail.com
Thu Mar 28 07:36:10 CET 2013


Revision: 55643
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55643
Author:   campbellbarton
Date:     2013-03-28 06:36:09 +0000 (Thu, 28 Mar 2013)
Log Message:
-----------
fix [#34636] bpy.app.handlers.load_post not run on startup file loading after splashscreen 

Modified Paths:
--------------
    trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c

Modified: trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c	2013-03-28 06:11:32 UTC (rev 55642)
+++ trunk/blender/source/blender/windowmanager/intern/wm_init_exit.c	2013-03-28 06:36:09 UTC (rev 55643)
@@ -47,6 +47,7 @@
 #include "DNA_userdef_types.h"
 #include "DNA_windowmanager_types.h"
 
+#include "BLI_callbacks.h"
 #include "BLI_listbase.h"
 #include "BLI_path_util.h"
 #include "BLI_string.h"
@@ -220,8 +221,17 @@
 #endif
 	
 	/* load last session, uses regular file reading so it has to be in end (after init py etc) */
-	if (U.uiflag2 & USER_KEEP_SESSION)
+	if (U.uiflag2 & USER_KEEP_SESSION) {
 		wm_recover_last_session(C, NULL);
+	}
+	else {
+		/* normally 'wm_homefile_read' will do this,
+		 * however python is not initialized when called from this function.
+		 *
+		 * unlikey any handlers are set but its possible,
+		 * note that recovering the last session does its own callbacks callbacks. */
+		BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
+	}
 }
 
 void WM_init_splash(bContext *C)




More information about the Bf-blender-cvs mailing list