diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-11-09 21:49:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-09 21:49:11 +0100 |
commit | 46780aaa0f208ac4d8c4179f77ce17af9c8877b8 (patch) | |
tree | b30c9769301701c4aa7f5cb0e74f722596ecea29 | |
parent | c305de701c81d027ab6de2855cb3b4432a4e6e7b (diff) | |
parent | bd0d15c5be0e360e6181b6a72d0bd738aea8dc05 (diff) |
Merge pull request #54694 from briansemrau/rem-silly-obj-error
Prevent obj importer from printing misleading error
-rw-r--r-- | editor/import/resource_importer_obj.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index 01af75c338..8eab27b533 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -405,11 +405,11 @@ static Error _parse_obj(const String &p_path, List<Ref<Mesh>> &r_meshes, bool p_ current_material_library = l.replace("mtllib", "").strip_edges(); if (!material_map.has(current_material_library)) { Map<String, Ref<StandardMaterial3D>> lib; - Error err = _parse_material_library(current_material_library, lib, r_missing_deps); - if (err == ERR_CANT_OPEN) { - String dir = p_path.get_base_dir(); - err = _parse_material_library(dir.plus_file(current_material_library), lib, r_missing_deps); + String lib_path = current_material_library; + if (lib_path.is_relative_path()) { + lib_path = p_path.get_base_dir().plus_file(current_material_library); } + Error err = _parse_material_library(lib_path, lib, r_missing_deps); if (err == OK) { material_map[current_material_library] = lib; } |