mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 09:19:01 +00:00
Changed: #964 Skip over deleted bones in skinning when exporting from max.
This commit is contained in:
parent
d0388890e9
commit
773d034a30
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++)
|
for (uint bone=0; bone<boneCount; bone++)
|
||||||
{
|
{
|
||||||
if (blendedInterface)
|
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
|
// Get the bone weight
|
||||||
float weight=blendedInterface->GetWeight(bone);
|
float weight=blendedInterface->GetWeight(bone);
|
||||||
|
|
||||||
// Get node
|
|
||||||
INode *node=blendedInterface->GetNode(bone);
|
|
||||||
nlassert (node);
|
|
||||||
|
|
||||||
// Insert in the map
|
// Insert in the map
|
||||||
weightMap.insert (std::map<float, INode*>::value_type (weight, node));
|
weightMap.insert (std::map<float, INode*>::value_type (weight, node));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Get node
|
// Get node
|
||||||
|
@ -1193,10 +1198,24 @@ void CExportNel::addSkeletonBindPos (INode& skinedNode, mapBoneBindPos& boneBind
|
||||||
// Get the bone pointer
|
// Get the bone pointer
|
||||||
INode *bone = blendedInterface->GetNode(boneIndex);
|
INode *bone = blendedInterface->GetNode(boneIndex);
|
||||||
|
|
||||||
|
if (bone == NULL)
|
||||||
|
{
|
||||||
|
nlwarning("bone == NULL; boneIndex = %i / %i", boneIndex, count);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// Get the bind matrix of the bone
|
// Get the bind matrix of the bone
|
||||||
Matrix3 bindPos;
|
Matrix3 bindPos;
|
||||||
int res = physiqueInterface->GetInitNodeTM (bone, 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
|
// Add an entry inthe map
|
||||||
if (boneBindPos.insert (mapBoneBindPos::value_type (bone, bindPos)).second)
|
if (boneBindPos.insert (mapBoneBindPos::value_type (bone, bindPos)).second)
|
||||||
|
@ -1237,6 +1256,7 @@ void CExportNel::addSkeletonBindPos (INode& skinedNode, mapBoneBindPos& boneBind
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Release vertex interfaces
|
// Release vertex interfaces
|
||||||
localData->ReleaseVertexInterface (vertexInterface);
|
localData->ReleaseVertexInterface (vertexInterface);
|
||||||
|
|
Loading…
Reference in a new issue