summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Zwoch <fzwoch@gmail.com>2018-02-21 10:43:57 +0100
committerFlorian Zwoch <fzwoc@dolby.com>2018-02-21 12:18:52 +0100
commit1abf464b59f66811f21e8ca02114327295841ada (patch)
treef0459f995dae2b28b513816ebba762622a399a4f
parentba48417147efef6c17d0e1d1a0f9f11b75c2648e (diff)
gltf: improve embedded data discovery
Some editors seems to use the image resource's mime type (e.g. "image/png") for data embedded uris instead of "application/octet-stream".
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index 1c4617c353..2636839764 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -1108,7 +1108,8 @@ Error EditorSceneImporterGLTF::_parse_images(GLTFState &state, const String &p_b
if (d.has("uri")) {
String uri = d["uri"];
- if (uri.findn("data:application/octet-stream;base64") == 0) {
+ if (uri.findn("data:application/octet-stream;base64") == 0 ||
+ uri.findn("data:" + mimetype + ";base64") == 0) {
//embedded data
data = _parse_base64_uri(uri);
data_ptr = data.ptr();