diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-09-22 06:30:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-09-22 06:30:12 +0300 |
commit | 98807ca751a92d8b0aceda21a37df08d98d9f5c5 (patch) | |
tree | f676d731d94a045a345911c3cb9f5fab53f7f899 /source/blender/windowmanager | |
parent | 28fa49f16808a8e1a143bbb88073a614c8eda27b (diff) |
Report loading file with no matching engine
Re-enable old code, now show in header instead of popup.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 7c4412661b6..98ea8b903b4 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -106,6 +106,9 @@ #include "GPU_draw.h" +/* only to report a missing engine */ +#include "RE_engine.h" + #ifdef WITH_PYTHON #include "BPY_extern.h" #endif @@ -436,6 +439,33 @@ 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); + } + } + } + if (!G.background) { /* in background mode this makes it hard to load * a blend file and do anything since the screen @@ -514,24 +544,6 @@ bool WM_file_read(bContext *C, const char *filepath, ReportList *reports) wm_file_read_post(C, false); -#if 0 - /* gives popups on windows but not linux, bug in report API - * but disable for now to stop users getting annoyed */ - /* TODO, make this show in header info window */ - { - 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) - { - 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); - } - } - } -#endif - success = true; } else if (retval == BKE_READ_EXOTIC_OK_OTHER) |