From a81f4dd5a7a92c2e7c7fc3185eeea745bd41cb5b Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Thu, 20 May 2021 14:08:59 -0700 Subject: [PATCH] When one invalid image fails, it should only fail that single image. Move to a more graceful degradation 3d asset import model. --- modules/gltf/gltf_document.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index e67e29f7b47..2d198b15f8f 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -3031,8 +3031,11 @@ Error GLTFDocument::_parse_images(Ref 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()); + continue; + } Ref t; t.instance();