Skip to content

Commit c5b674a

Browse files
committed
blender/import: correct exit code on Python exception
1 parent 607b230 commit c5b674a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/gltf/editor/editor_import_blend_runner.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,18 @@ Error EditorImportBlendRunner::start_blender(const String &p_python_script, bool
163163

164164
List<String> args;
165165
args.push_back("--background");
166+
args.push_back("--python-exit-code");
167+
args.push_back("1");
166168
args.push_back("--python-expr");
167169
args.push_back(p_python_script);
168170

169171
Error err;
172+
String str;
170173
if (p_blocking) {
171174
int exitcode = 0;
172-
err = OS::get_singleton()->execute(blender_path, args, nullptr, &exitcode);
175+
err = OS::get_singleton()->execute(blender_path, args, &str, &exitcode, true);
173176
if (exitcode != 0) {
177+
print_error(vformat("Blender import failed: %s.", str));
174178
return FAILED;
175179
}
176180
} else {

0 commit comments

Comments
 (0)