[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50514] trunk/blender/source/blender/ windowmanager/intern/wm_files.c: 'new file' now runs bpy.app.handlers. load_pre/post callbacks.

Campbell Barton ideasman42 at gmail.com
Tue Sep 11 01:36:07 CEST 2012


Revision: 50514
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50514
Author:   campbellbarton
Date:     2012-09-10 23:36:07 +0000 (Mon, 10 Sep 2012)
Log Message:
-----------
'new file' now runs bpy.app.handlers.load_pre/post callbacks.

Without this - there wasnt a good way to ensure addons were aware of new data being loading in new files.
requested by request by liquidape and maccuno.

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

Modified: trunk/blender/source/blender/windowmanager/intern/wm_files.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_files.c	2012-09-10 23:32:46 UTC (rev 50513)
+++ trunk/blender/source/blender/windowmanager/intern/wm_files.c	2012-09-10 23:36:07 UTC (rev 50514)
@@ -489,6 +489,8 @@
 	char tstr[FILE_MAX];
 	int success = 0;
 
+	BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_PRE);
+
 	G.relbase_valid = 0;
 	if (!from_memory) {
 		char *cfgdir = BLI_get_folder(BLENDER_USER_CONFIG, NULL);
@@ -566,6 +568,9 @@
 	}
 #endif
 
+	/* important to do before NULL'ing the context */
+	BLI_callback_exec(CTX_data_main(C), NULL, BLI_CB_EVT_LOAD_POST);
+
 	WM_event_add_notifier(C, NC_WM | ND_FILEREAD, NULL);
 
 	/* in background mode the scene will stay NULL */




More information about the Bf-blender-cvs mailing list