mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #94873 from kroketio/blender-exitcode
blender/import: correct exit code on Python exception
This commit is contained in:
commit
dfc38d2a3f
1 changed files with 5 additions and 1 deletions
|
|
@ -159,14 +159,18 @@ Error EditorImportBlendRunner::start_blender(const String &p_python_script, bool
|
||||||
|
|
||||||
List<String> args;
|
List<String> args;
|
||||||
args.push_back("--background");
|
args.push_back("--background");
|
||||||
|
args.push_back("--python-exit-code");
|
||||||
|
args.push_back("1");
|
||||||
args.push_back("--python-expr");
|
args.push_back("--python-expr");
|
||||||
args.push_back(p_python_script);
|
args.push_back(p_python_script);
|
||||||
|
|
||||||
Error err;
|
Error err;
|
||||||
|
String str;
|
||||||
if (p_blocking) {
|
if (p_blocking) {
|
||||||
int exitcode = 0;
|
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) {
|
if (exitcode != 0) {
|
||||||
|
print_error(vformat("Blender import failed: %s.", str));
|
||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue