Merge pull request #3288 from infosia/themachinery-issues-0001

Check invalid vertex id for bone weight
pull/3296/head
Kim Kulling 2020-06-20 21:40:18 +02:00 committed by GitHub
commit c70d57be4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -114,6 +114,10 @@ void LimitBoneWeightsProcess::ProcessMesh(aiMesh* pMesh)
for (unsigned int w = 0; w < bone->mNumWeights; ++w)
{
const aiVertexWeight& vw = bone->mWeights[w];
if (vertexWeights.size() <= vw.mVertexId)
continue;
vertexWeights[vw.mVertexId].push_back(Weight(b, vw.mWeight));
maxVertexWeights = std::max(maxVertexWeights, vertexWeights[vw.mVertexId].size());
}