summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorcyclopsian <cycl0ps@tuta.io>2018-09-16 22:23:40 -0400
committercyclopsian <cycl0ps@tuta.io>2018-09-16 22:23:40 -0400
commit45ba58c12376ab503230e5a4650648486042d936 (patch)
tree3a99d20f3352b607685c288307dcc295c65b281e /editor
parente522baf0b78ae475685e890059afd7f402b21541 (diff)
Check for absolute paths in OBJ loader
Diffstat (limited to 'editor')
-rw-r--r--editor/import/resource_importer_obj.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp
index b18bbc8ce9..c237d2e854 100644
--- a/editor/import/resource_importer_obj.cpp
+++ b/editor/import/resource_importer_obj.cpp
@@ -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);
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);
@@ -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);
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);
@@ -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);
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);