diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-07-22 13:49:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-22 13:49:19 +0200 |
commit | 8495acc510e54c0d148b9d97c3f78f22ce16fa15 (patch) | |
tree | 8b53aad9deef1ca8a193ae26d890e2daaaf8453d /editor | |
parent | f0ab3283c072c9a9a86b9fdbe0cd334ec4b39c31 (diff) | |
parent | 0bc5fca4d5a743cb5575a968e097da4add81109f (diff) |
Merge pull request #9754 from Hinsbart/obj_fix
OBJ Importer: Fix relative path materials.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/import/resource_importer_obj.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp index 9bb598ec92..25548f7899 100644 --- a/editor/import/resource_importer_obj.cpp +++ b/editor/import/resource_importer_obj.cpp @@ -395,6 +395,10 @@ Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, in if (!material_map.has(current_material_library)) { Map<String, Ref<SpatialMaterial> > 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); + } if (err == OK) { material_map[current_material_library] = lib; } |