Merge pull request #232 from kacprzak/master

Do not set target on bufferView pointing to animation data
This commit is contained in:
Syoyo Fujita 2020-01-02 21:53:53 +09:00 committed by GitHub
commit 9cc3e91968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5526,7 +5526,7 @@ bool TinyGLTF::LoadFromString(Model *model, std::string *err, std::string *warn,
// Assign missing bufferView target types // Assign missing bufferView target types
// - Look for missing Mesh indices // - Look for missing Mesh indices
// - Look for missing bufferView targets // - Look for missing Mesh attributes
for (auto &mesh : model->meshes) { for (auto &mesh : model->meshes) {
for (auto &primitive : mesh.primitives) { for (auto &primitive : mesh.primitives) {
if (primitive.indices > if (primitive.indices >
@ -5554,14 +5554,11 @@ bool TinyGLTF::LoadFromString(Model *model, std::string *err, std::string *warn,
// we could optionally check if acessors' bufferView type is Scalar, as // we could optionally check if acessors' bufferView type is Scalar, as
// it should be // it should be
} }
}
} for (auto &attribute : primitive.attributes) {
// find any missing targets, must be an array buffer type if not fulfilled model->bufferViews[model->accessors[attribute.second].bufferView]
// from previous check .target = TINYGLTF_TARGET_ARRAY_BUFFER;
for (auto &bufferView : model->bufferViews) { }
if (bufferView.target == 0) // missing target type
{
bufferView.target = TINYGLTF_TARGET_ARRAY_BUFFER;
} }
} }