Fixes a crash from importing shapes with unnamed bones.

This commit is contained in:
OTHGMars 2019-03-29 04:02:41 -04:00
parent d094137107
commit 186a44fab3

View file

@ -201,7 +201,10 @@ void AssimpAppMesh::lockMesh(F32 t, const MatrixF& objOffset)
{
String name = mMeshData->mBones[b]->mName.C_Str();
aiNode* nodePtr = AssimpAppNode::findChildNodeByName(mMeshData->mBones[b]->mName.C_Str(), appNode->mScene->mRootNode);
bones[b] = new AssimpAppNode(appNode->mScene, nodePtr);
if (!nodePtr)
bones[b] = new AssimpAppNode(appNode->mScene, appNode->mNode);
else
bones[b] = new AssimpAppNode(appNode->mScene, nodePtr);
MatrixF boneTransform;
AssimpAppNode::assimpToTorqueMat(mMeshData->mBones[b]->mOffsetMatrix, boneTransform);