Verbose processor bone weight count fix

pull/4174/head
freizhang 2021-11-13 11:56:15 +08:00
parent 1407491a67
commit 6e6807ee6c
1 changed files with 1 additions and 0 deletions

View File

@ -161,6 +161,7 @@ bool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh *pcMesh) {
delete[] pcMesh->mBones[i]->mWeights;
if (!newWeights[i].empty()) {
pcMesh->mBones[i]->mWeights = new aiVertexWeight[newWeights[i].size()];
pcMesh->mBones[i]->mNumWeights = static_cast<unsigned int>(newWeights[i].size());
aiVertexWeight *weightToCopy = &(newWeights[i][0]);
memcpy(pcMesh->mBones[i]->mWeights, weightToCopy,
sizeof(aiVertexWeight) * newWeights[i].size());