diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-09-22 09:45:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-09-22 09:53:07 +0300 |
commit | e29f8c600b729e42ccdf5427e79ec4d8768dd0bf (patch) | |
tree | f9519862f282012062f183a43601d21ddaaa65cc /source/blender/windowmanager/intern/wm_files.c | |
parent | b87cb9ad2c33ace0424f0b2ca8399edce0896a48 (diff) |
Reporting was done before before addons were loaded
On the very first start, reporting of missing engines wasn't working.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_files.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 59 |
1 files changed, 34 insertions, 25 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 98ea8b903b4..d08c6c59a7f 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -404,12 +404,40 @@ void WM_file_autoexec_init(const char *filepath) } } +void wm_file_read_report(bContext *C) +{ + ReportList *reports = NULL; + Scene *sce; + + for (sce = G.main->scene.first; sce; sce = sce->id.next) { + if (sce->r.engine[0] && + BLI_findstring(&R_engines, sce->r.engine, offsetof(RenderEngineType, idname)) == NULL) + { + if (reports == NULL) { + reports = CTX_wm_reports(C); + } + + BKE_reportf(reports, RPT_ERROR, + "Engine '%s' not available for scene '%s' " + "(an addon may need to be installed or enabled)", + sce->r.engine, sce->id.name + 2); + } + } + + if (reports) { + if (!G.background) { + WM_report_banner_show(C); + } + } +} + /** * Logic shared between #WM_file_read & #wm_homefile_read, * updates to make after reading a file. */ static void wm_file_read_post(bContext *C, bool is_startup_file) { + bool addons_loaded = false; CTX_wm_window_set(C, CTX_wm_manager(C)->windows.first); ED_editors_init(C); @@ -423,11 +451,13 @@ static void wm_file_read_post(bContext *C, bool is_startup_file) BPY_string_exec(C, "__import__('addon_utils').reset_all()"); BPY_python_reset(C); + addons_loaded = true; } } else { /* run any texts that were loaded in and flagged as modules */ BPY_python_reset(C); + addons_loaded = true; } #endif /* WITH_PYTHON */ @@ -439,31 +469,10 @@ static void wm_file_read_post(bContext *C, bool is_startup_file) WM_event_add_notifier(C, NC_WM | ND_FILEREAD, NULL); - /* report any errors */ - { - ReportList *reports = NULL; - Scene *sce; - - for (sce = G.main->scene.first; sce; sce = sce->id.next) { - if (sce->r.engine[0] && - BLI_findstring(&R_engines, sce->r.engine, offsetof(RenderEngineType, idname)) == NULL) - { - if (reports == NULL) { - reports = CTX_wm_reports(C); - } - - BKE_reportf(reports, RPT_ERROR, - "Engine '%s' not available for scene '%s' " - "(an addon may need to be installed or enabled)", - sce->r.engine, sce->id.name + 2); - } - } - - if (reports) { - if (!G.background) { - WM_report_banner_show(C); - } - } + /* report any errors. + * currently disabled if addons aren't yet loaded */ + if (addons_loaded) { + wm_file_read_report(C); } if (!G.background) { |