Check invalid vertex id for bone weight
parent
c2a732938e
commit
6acaaee80f
|
@ -114,6 +114,10 @@ void LimitBoneWeightsProcess::ProcessMesh(aiMesh* pMesh)
|
||||||
for (unsigned int w = 0; w < bone->mNumWeights; ++w)
|
for (unsigned int w = 0; w < bone->mNumWeights; ++w)
|
||||||
{
|
{
|
||||||
const aiVertexWeight& vw = bone->mWeights[w];
|
const aiVertexWeight& vw = bone->mWeights[w];
|
||||||
|
|
||||||
|
if (vertexWeights.size() <= vw.mVertexId)
|
||||||
|
continue;
|
||||||
|
|
||||||
vertexWeights[vw.mVertexId].push_back(Weight(b, vw.mWeight));
|
vertexWeights[vw.mVertexId].push_back(Weight(b, vw.mWeight));
|
||||||
maxVertexWeights = std::max(maxVertexWeights, vertexWeights[vw.mVertexId].size());
|
maxVertexWeights = std::max(maxVertexWeights, vertexWeights[vw.mVertexId].size());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue