Merge pull request #94873 from kroketio/blender-exitcode

blender/import: correct exit code on Python exception
This commit is contained in:
Thaddeus Crews
2025-11-19 11:04:06 -06:00

View File

@ -159,14 +159,18 @@ Error EditorImportBlendRunner::start_blender(const String &p_python_script, bool
List<String> args;
args.push_back("--background");
args.push_back("--python-exit-code");
args.push_back("1");
args.push_back("--python-expr");
args.push_back(p_python_script);
Error err;
String str;
if (p_blocking) {
int exitcode = 0;
err = OS::get_singleton()->execute(blender_path, args, nullptr, &exitcode);
err = OS::get_singleton()->execute(blender_path, args, &str, &exitcode, true);
if (exitcode != 0) {
print_error(vformat("Blender import failed: %s.", str));
return FAILED;
}
} else {