diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-05-21 00:32:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 00:32:48 +0200 |
commit | 37a417e83878927d725fe8b244ac1c486468a8a9 (patch) | |
tree | 38c642e4e313ad04575aa07fc0e3e97a728a7a8e /modules | |
parent | bfe4af91a26787c11c3d4c84a216d6d728322035 (diff) | |
parent | a81f4dd5a7a92c2e7c7fc3185eeea745bd41cb5b (diff) |
Merge pull request #48904 from fire/gltf-img-failure
When one invalid image fails, it should only fail that single image.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gltf/gltf_document.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index acc28ae2ac..7b0392fbc1 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -3031,8 +3031,11 @@ Error GLTFDocument::_parse_images(Ref<GLTFState> state, const String &p_base_pat } } - ERR_FAIL_COND_V_MSG(img.is_null(), ERR_FILE_CORRUPT, - vformat("glTF: Couldn't load image index '%d' with its given mimetype: %s.", i, mimetype)); + if (img.is_null()) { + ERR_PRINT(vformat("glTF: Couldn't load image index '%d' with its given mimetype: %s.", i, mimetype)); + state->images.push_back(Ref<Texture2D>()); + continue; + } Ref<ImageTexture> t; t.instance(); |