fix bug, do not add null bones (#16948)

This commit is contained in:
Huabing.Xu 2016-12-29 15:44:57 +08:00 committed by minggo
parent e4e872a065
commit 0564d43478
1 changed files with 4 additions and 1 deletions

View File

@ -53,7 +53,10 @@ MeshSkin* MeshSkin::create(Skeleton3D* skeleton, const std::vector<std::string>&
CCASSERT(boneNames.size() == invBindPose.size(), "bone names' num should equals to invBindPose's num");
for (const auto& it : boneNames) {
auto bone = skeleton->getBoneByName(it);
skin->addSkinBone(bone);
if (bone)
{
skin->addSkinBone(bone);
}
}
skin->_invBindPoses = invBindPose;
skin->autorelease();