mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Check for absolute paths in OBJ loader
(cherry picked from commit 45ba58c123)
This commit is contained in:
committed by
Rémi Verschelde
parent
7ac73098fc
commit
049c91f4d1
@@ -126,7 +126,12 @@ static Error _parse_material_library(const String &p_path, Map<String, Ref<Spati
|
|||||||
ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
|
ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
|
||||||
|
|
||||||
String p = l.replace("map_Kd", "").replace("\\", "/").strip_edges();
|
String p = l.replace("map_Kd", "").replace("\\", "/").strip_edges();
|
||||||
String path = base_path.plus_file(p);
|
String path;
|
||||||
|
if (p.is_abs_path()) {
|
||||||
|
path = p;
|
||||||
|
} else {
|
||||||
|
path = base_path.plus_file(p);
|
||||||
|
}
|
||||||
|
|
||||||
Ref<Texture> texture = ResourceLoader::load(path);
|
Ref<Texture> texture = ResourceLoader::load(path);
|
||||||
|
|
||||||
@@ -141,7 +146,12 @@ static Error _parse_material_library(const String &p_path, Map<String, Ref<Spati
|
|||||||
ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
|
ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
|
||||||
|
|
||||||
String p = l.replace("map_Ks", "").replace("\\", "/").strip_edges();
|
String p = l.replace("map_Ks", "").replace("\\", "/").strip_edges();
|
||||||
String path = base_path.plus_file(p);
|
String path;
|
||||||
|
if (p.is_abs_path()) {
|
||||||
|
path = p;
|
||||||
|
} else {
|
||||||
|
path = base_path.plus_file(p);
|
||||||
|
}
|
||||||
|
|
||||||
Ref<Texture> texture = ResourceLoader::load(path);
|
Ref<Texture> texture = ResourceLoader::load(path);
|
||||||
|
|
||||||
@@ -156,7 +166,12 @@ static Error _parse_material_library(const String &p_path, Map<String, Ref<Spati
|
|||||||
ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
|
ERR_FAIL_COND_V(current.is_null(), ERR_FILE_CORRUPT);
|
||||||
|
|
||||||
String p = l.replace("map_Ns", "").replace("\\", "/").strip_edges();
|
String p = l.replace("map_Ns", "").replace("\\", "/").strip_edges();
|
||||||
String path = base_path.plus_file(p);
|
String path;
|
||||||
|
if (p.is_abs_path()) {
|
||||||
|
path = p;
|
||||||
|
} else {
|
||||||
|
path = base_path.plus_file(p);
|
||||||
|
}
|
||||||
|
|
||||||
Ref<Texture> texture = ResourceLoader::load(path);
|
Ref<Texture> texture = ResourceLoader::load(path);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user