From dfb7885a9397fb57012d1530219722d84ab331eb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 10 Sep 2012 23:36:07 +0000 Subject: '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. --- source/blender/windowmanager/intern/wm_files.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source') diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 48b552acf26..46a669eb495 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -489,6 +489,8 @@ int WM_homefile_read(bContext *C, ReportList *UNUSED(reports), short from_memory 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 @@ int WM_homefile_read(bContext *C, ReportList *UNUSED(reports), short from_memory } #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 */ -- cgit v1.2.3