From fb58f88a4ed3d2a4d39b49371775c0790d23f703 Mon Sep 17 00:00:00 2001 From: Thomas Gamper Date: Thu, 4 Jul 2024 11:35:13 +0200 Subject: [PATCH] Properly clear the model before loading --- tiny_gltf.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index e0f99cc..2fa0c21 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -6108,16 +6108,8 @@ bool TinyGLTF::LoadFromString(Model *model, std::string *err, std::string *warn, } } - model->buffers.clear(); - model->bufferViews.clear(); - model->accessors.clear(); - model->meshes.clear(); - model->cameras.clear(); - model->nodes.clear(); - model->extensionsUsed.clear(); - model->extensionsRequired.clear(); - model->extensions.clear(); - model->defaultScene = -1; + // Reset the model + (*model) = Model(); // 1. Parse Asset {