From d5b6cb4639f2f297d9cc7761984de2b6785ba993 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. (cherry picked from commit a81f4dd5a7a92c2e7c7fc3185eeea745bd41cb5b) --- editor/import/editor_scene_importer_gltf.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index df220935f52..3bda1b89c61 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -1451,8 +1451,11 @@ Error EditorSceneImporterGLTF::_parse_images(GLTFState &state, const String &p_b } } - 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();