diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-09-11 03:36:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-09-11 03:36:07 +0400 |
commit | dfb7885a9397fb57012d1530219722d84ab331eb (patch) | |
tree | aa5cd394a3f202cc908984dc4cc127ace8f270c7 /source/blender/windowmanager | |
parent | cf5da37e3c4c8ed4bf5e0427d06b0e5c55f2059c (diff) |
'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.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 */ |