Fix sparse morph targets

This commit is contained in:
Rahul Sheth 2020-07-13 13:56:50 -04:00
parent c9d6c5b9b4
commit 125e4a2033

View File

@ -5709,10 +5709,12 @@ bool TinyGLTF::LoadFromString(Model *model, std::string *err, std::string *warn,
for (auto &target : primitive.targets) { for (auto &target : primitive.targets) {
for (auto &attribute : target) { for (auto &attribute : target) {
model auto bufferView =
->bufferViews[size_t( model->accessors[size_t(attribute.second)].bufferView;
model->accessors[size_t(attribute.second)].bufferView)] if (bufferView > 0) {
.target = TINYGLTF_TARGET_ARRAY_BUFFER; model->bufferViews[size_t(bufferView)].target =
TINYGLTF_TARGET_ARRAY_BUFFER;
}
} }
} }
} }