mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-18 17:37:30 +02:00
Fix multiple blendshapes targeted to one model blendshape
This commit is contained in:
parent
5d02e0fe28
commit
0fcc73d5cd
1 changed files with 8 additions and 4 deletions
|
@ -1593,11 +1593,15 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
|||
generateTargetData(target.values.value((QString) "POSITION"), weight, vertices);
|
||||
}
|
||||
|
||||
auto blendshapeIndicesCount = blendshape.indices.count();
|
||||
if (blendshape.indices.size() < prevMeshVerticesCount + vertices.size()) {
|
||||
blendshape.indices.resize(prevMeshVerticesCount + vertices.size());
|
||||
blendshape.vertices.resize(prevMeshVerticesCount + vertices.size());
|
||||
blendshape.normals.resize(prevMeshVerticesCount + vertices.size());
|
||||
}
|
||||
for (int i = 0; i < vertices.size(); i++) {
|
||||
blendshape.indices.push_back(blendshapeIndicesCount + i);
|
||||
blendshape.vertices.push_back(vertices.value(i));
|
||||
blendshape.normals.push_back(normals.value(i));
|
||||
blendshape.indices[prevMeshVerticesCount + i] = prevMeshVerticesCount + i;
|
||||
blendshape.vertices[prevMeshVerticesCount + i] += vertices.value(i);
|
||||
blendshape.normals[prevMeshVerticesCount + i] += normals.value(i);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue