diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-06 22:45:18 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-06 22:45:18 +0100 |
commit | 6e2b9b3bdc5fbf41a4c7d3f520445c4987aaf60d (patch) | |
tree | 3b107cb8cf9985ea1db22f988481e0e3b94a12a1 /modules/gltf | |
parent | 945207885b3cd97012215334e56fcd3139d25e9f (diff) | |
parent | 8f099c7de3cb664266faad5bd2b469e07925b8e0 (diff) |
Merge pull request #72802 from RedMser/blender-rpc-error-handling
Better error handling for Blender RPC import
Diffstat (limited to 'modules/gltf')
-rw-r--r-- | modules/gltf/editor/editor_import_blend_runner.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/gltf/editor/editor_import_blend_runner.cpp b/modules/gltf/editor/editor_import_blend_runner.cpp index c203a91834..659a60e6a1 100644 --- a/modules/gltf/editor/editor_import_blend_runner.cpp +++ b/modules/gltf/editor/editor_import_blend_runner.cpp @@ -181,7 +181,18 @@ Error EditorImportBlendRunner::start_blender(const String &p_python_script, bool Error EditorImportBlendRunner::do_import(const Dictionary &p_options) { if (is_using_rpc()) { - return do_import_rpc(p_options); + Error err = do_import_rpc(p_options); + if (err != OK) { + // Retry without using RPC (slow, but better than the import failing completely). + if (err == ERR_CONNECTION_ERROR) { + // Disable RPC if the connection could not be established. + print_error(vformat("Failed to connect to Blender via RPC, switching to direct imports of .blend files. Check your proxy and firewall settings, then RPC can be re-enabled by changing the editor setting `filesystem/import/blender/rpc_port` to %d.", rpc_port)); + EditorSettings::get_singleton()->set_manually("filesystem/import/blender/rpc_port", 0); + rpc_port = 0; + } + err = do_import_direct(p_options); + } + return err; } else { return do_import_direct(p_options); } |