mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +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;
|
||||
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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue