Merge pull request #16277 from sabrina-shanman/instancing_too-many-deformers

Fix skinning deformer data always being added to graphics::Mesh
This commit is contained in:
Sabrina Shanman 2019-10-02 13:04:42 -07:00 committed by GitHub
commit a83d2b4561
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,8 +12,12 @@
#include "ReweightDeformersTask.h"
baker::ReweightedDeformers getReweightedDeformers(size_t numMeshVertices, const std::vector<const hfm::Deformer*> deformers, const uint16_t weightsPerVertex) {
size_t numClusterIndices = numMeshVertices * weightsPerVertex;
baker::ReweightedDeformers reweightedDeformers;
if (deformers.size() == 0) {
return reweightedDeformers;
}
size_t numClusterIndices = numMeshVertices * weightsPerVertex;
reweightedDeformers.weightsPerVertex = weightsPerVertex;
// TODO: Consider having a rootCluster property in the DynamicTransform rather than appending the root to the end of the cluster list.
reweightedDeformers.indices.resize(numClusterIndices, (uint16_t)(deformers.size() - 1));