From e1fc7776f640e4d9aafad63d7e849ad5043194ca Mon Sep 17 00:00:00 2001 From: Florian Zwoch Date: Wed, 21 Feb 2018 10:43:57 +0100 Subject: [PATCH] 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". (cherry picked from commit 1abf464b59f66811f21e8ca02114327295841ada) --- editor/import/editor_scene_importer_gltf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 1c4617c353d..26368397649 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();