Changed: #964 Skip over deleted bones in skinning when exporting from max.
This commit is contained in:
parent
e3ea920741
commit
f362c9363b
1 changed files with 61 additions and 41 deletions
|
@ -747,17 +747,22 @@ uint CExportNel::buildSkinning (CMesh::CMeshBuild& buildMesh, const TInodePtrInt
|
|||
for (uint bone=0; bone<boneCount; bone++)
|
||||
{
|
||||
if (blendedInterface)
|
||||
{
|
||||
// Get node
|
||||
INode *node=blendedInterface->GetNode(bone);
|
||||
if (node == NULL)
|
||||
{
|
||||
nlwarning("node == NULL; bone = %i / %i", bone, boneCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the bone weight
|
||||
float weight=blendedInterface->GetWeight(bone);
|
||||
|
||||
// Get node
|
||||
INode *node=blendedInterface->GetNode(bone);
|
||||
nlassert (node);
|
||||
|
||||
// Insert in the map
|
||||
weightMap.insert (std::map<float, INode*>::value_type (weight, node));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get node
|
||||
|
@ -1193,10 +1198,24 @@ void CExportNel::addSkeletonBindPos (INode& skinedNode, mapBoneBindPos& boneBind
|
|||
// Get the bone pointer
|
||||
INode *bone = blendedInterface->GetNode(boneIndex);
|
||||
|
||||
if (bone == NULL)
|
||||
{
|
||||
nlwarning("bone == NULL; boneIndex = %i / %i", boneIndex, count);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the bind matrix of the bone
|
||||
Matrix3 bindPos;
|
||||
int res = physiqueInterface->GetInitNodeTM (bone, bindPos);
|
||||
nlassert (res==MATRIX_RETURNED);
|
||||
|
||||
if (res != MATRIX_RETURNED)
|
||||
{
|
||||
nlwarning("res != MATRIX_RETURNED; res = %i; boneIndex = %i / %i", res, boneIndex, count);
|
||||
nlwarning("bone = %i", (uint32)(void *)bone);
|
||||
std::string boneName = getName (*bone);
|
||||
nlwarning("boneName = %s", boneName.c_str());
|
||||
nlassert(false);
|
||||
}
|
||||
|
||||
// Add an entry inthe map
|
||||
if (boneBindPos.insert (mapBoneBindPos::value_type (bone, bindPos)).second)
|
||||
|
@ -1237,6 +1256,7 @@ void CExportNel::addSkeletonBindPos (INode& skinedNode, mapBoneBindPos& boneBind
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Release vertex interfaces
|
||||
localData->ReleaseVertexInterface (vertexInterface);
|
||||
|
|
Loading…
Reference in a new issue