Merge pull request #48904 from fire/gltf-img-failure

When one invalid image fails, it should only fail that single image.
This commit is contained in:
Rémi Verschelde 2021-05-21 00:32:48 +02:00 committed by GitHub
commit 37a417e838
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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, if (img.is_null()) {
vformat("glTF: Couldn't load image index '%d' with its given mimetype: %s.", i, mimetype)); 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; Ref<ImageTexture> t;
t.instance(); t.instance();