|
|
|
@ -748,16 +748,21 @@ uint CExportNel::buildSkinning (CMesh::CMeshBuild& buildMesh, const TInodePtrInt
|
|
|
|
|
{
|
|
|
|
|
if (blendedInterface)
|
|
|
|
|
{
|
|
|
|
|
// Get the bone weight
|
|
|
|
|
float weight=blendedInterface->GetWeight(bone);
|
|
|
|
|
|
|
|
|
|
// Get node
|
|
|
|
|
INode *node=blendedInterface->GetNode(bone);
|
|
|
|
|
nlassert (node);
|
|
|
|
|
if (node == NULL)
|
|
|
|
|
{
|
|
|
|
|
nlwarning("node == NULL; bone = %i / %i", bone, boneCount);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Get the bone weight
|
|
|
|
|
float weight=blendedInterface->GetWeight(bone);
|
|
|
|
|
|
|
|
|
|
// 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);
|
|
|
|
|