From c3d6716c56bc8a35d68e0aa2817fc86b12b9d10e Mon Sep 17 00:00:00 2001 From: Marcin Kacprzak Date: Wed, 22 Jan 2020 13:13:35 +0100 Subject: [PATCH] Set target for bufferView used by MorphTargets --- tiny_gltf.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tiny_gltf.h b/tiny_gltf.h index 5b0aca5..27a4322 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -5570,6 +5570,13 @@ bool TinyGLTF::LoadFromString(Model *model, std::string *err, std::string *warn, model->bufferViews[size_t(model->accessors[size_t(attribute.second)].bufferView)] .target = TINYGLTF_TARGET_ARRAY_BUFFER; } + + for(auto &target : primitive.targets) { + for(auto &attribute : target) { + model->bufferViews[size_t(model->accessors[size_t(attribute.second)].bufferView)] + .target = TINYGLTF_TARGET_ARRAY_BUFFER; + } + } } }