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 1abf464b59)
This commit is contained in:
Florian Zwoch 2018-02-21 10:43:57 +01:00 committed by Hein-Pieter van Braam
parent c6a96fc360
commit e1fc7776f6

View file

@ -1108,7 +1108,8 @@ Error EditorSceneImporterGLTF::_parse_images(GLTFState &state, const String &p_b
if (d.has("uri")) { if (d.has("uri")) {
String uri = d["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 //embedded data
data = _parse_base64_uri(uri); data = _parse_base64_uri(uri);
data_ptr = data.ptr(); data_ptr = data.ptr();