From 930d28e6cb941f9876ed9def6c923313f2b158d3 Mon Sep 17 00:00:00 2001 From: Brian Semrau Date: Sat, 6 Nov 2021 22:12:36 -0400 Subject: [PATCH] Prevent obj importer from printing misleading error (cherry picked from commit bd0d15c5be0e360e6181b6a72d0bd738aea8dc05) --- editor/import/resource_importer_obj.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index f2a7ff35729..6dfd6c8dc29 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -391,11 +391,11 @@ static Error _parse_obj(const String &p_path, List> &r_meshes, bool p_ current_material_library = l.replace("mtllib", "").strip_edges(); if (!material_map.has(current_material_library)) { Map> 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_rel_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; }