From 8a99ab4463032b69eaca4e91e2d3f48c4169d468 Mon Sep 17 00:00:00 2001 From: Jesse Yurkovich Date: Tue, 7 Oct 2025 20:37:15 +0200 Subject: [PATCH] Fix #145919: Enable BKE_reports to be seen when file is loaded from CLI There were two issues conspiring to prevent most BKE_reports from surfacing when loading a file from the command line. The first is that the "print_level" was left initialized to only RPT_ERROR which prevents this particular warning from being traced to the console. The second is that, in order for us to display reports in the notification area, we need to give the reports to the window manager. This is typically all wired up during normal operator execution, but not when just starting up from the command line. Pull Request: https://projects.blender.org/blender/blender/pulls/147251 --- source/creator/creator_args.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/creator/creator_args.cc b/source/creator/creator_args.cc index 9d114f2ef7d..0b08ba509b6 100644 --- a/source/creator/creator_args.cc +++ b/source/creator/creator_args.cc @@ -2713,12 +2713,16 @@ static bool handle_load_file(bContext *C, const char *filepath_arg, const bool l /* Load the file. */ ReportList reports; - BKE_reports_init(&reports, RPT_PRINT); + BKE_reports_init(&reports, RPT_PRINT | RPT_STORE); + BKE_report_print_level_set(&reports, RPT_WARNING); /* When activating from the command line there isn't an exact equivalent to operator properties. * Instead, enabling auto-execution via `--enable-autoexec` causes the auto-execution * check to be skipped (if it's set), so it's fine to always enable the check here. */ const bool use_scripts_autoexec_check = true; const bool success = WM_file_read(C, filepath, use_scripts_autoexec_check, &reports); + + wmWindowManager *wm = CTX_wm_manager(C); + WM_reports_from_reports_move(wm, &reports); BKE_reports_free(&reports); if (success) {