From 1cc6477c02b565c4cb315b603e3c01360a6ff8fe 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 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index e0f99cc..97271a6 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -6108,12 +6108,22 @@ bool TinyGLTF::LoadFromString(Model *model, std::string *err, std::string *warn, } } + model->accessors.clear(); + model->animations.clear(); model->buffers.clear(); model->bufferViews.clear(); - model->accessors.clear(); + model->materials.clear(); model->meshes.clear(); - model->cameras.clear(); model->nodes.clear(); + model->textures.clear(); + model->images.clear(); + model->skins.clear(); + model->samplers.clear(); + model->cameras.clear(); + model->scenes.clear(); + model->lights.clear(); + model->audioEmitters.clear(); + model->audioSources.clear(); model->extensionsUsed.clear(); model->extensionsRequired.clear(); model->extensions.clear();