mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-14 21:15:52 +08:00
Do not set target on bufferView pointing to animation data
This commit is contained in:
parent
a11f6e1939
commit
d09788d10f
15
tiny_gltf.h
15
tiny_gltf.h
@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user