OBJ Importer: Fix relative path materials.
This commit is contained in:
parent
9cf72d0ae1
commit
0bc5fca4d5
1 changed files with 4 additions and 0 deletions
|
@ -395,6 +395,10 @@ Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, in
|
||||||
if (!material_map.has(current_material_library)) {
|
if (!material_map.has(current_material_library)) {
|
||||||
Map<String, Ref<SpatialMaterial> > lib;
|
Map<String, Ref<SpatialMaterial> > lib;
|
||||||
Error err = _parse_material_library(current_material_library, lib, r_missing_deps);
|
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) {
|
if (err == OK) {
|
||||||
material_map[current_material_library] = lib;
|
material_map[current_material_library] = lib;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue