Remove redundant and ambiguous NiNode::makeBone()

Ambiguous because a skeleton can have multiple skinned meshes, with their own bone weights/bind matrix each.
pull/174/head
scrawl 7 years ago
parent aba3c471a9
commit 9b27ec4945

@ -23,13 +23,11 @@ void NiSkinInstance::post(NIFFile *nif)
if(bnum != data->bones.size())
nif->fail("Mismatch in NiSkinData bone count");
root->makeRootBone(&data->trafo);
for(size_t i=0; i<bnum; i++)
{
if(bones[i].empty())
nif->fail("Oops: Missing bone! Don't know how to handle this.");
bones[i]->makeBone(i, data->bones[i]);
bones[i]->setBone();
}
}

@ -55,8 +55,7 @@ public:
parent = NULL;
boneTrafo = NULL;
boneIndex = -1;
isBone = false;
}
void post(NIFFile *nif)
@ -69,27 +68,11 @@ public:
// NiNodes (or types derived from NiNodes) can be parents.
NiNode *parent;
// Bone transformation. If set, node is a part of a skeleton.
const Transformation *boneTrafo;
bool isBone;
// Bone weight info, from NiSkinData
const NiSkinData::BoneInfo *boneInfo;
// Bone index. If -1, this node is either not a bone, or if
// boneTrafo is set it is the root bone in the skeleton.
short boneIndex;
void makeRootBone(const Transformation *tr)
{
boneTrafo = tr;
boneIndex = -1;
}
void makeBone(short ind, const NiSkinData::BoneInfo &bi)
void setBone()
{
boneInfo = &bi;
boneTrafo = &bi.trafo;
boneIndex = ind;
isBone = true;
}
};

@ -542,7 +542,7 @@ namespace NifOsg
dataVariance = (nifNode->controller.empty() ? osg::Object::STATIC : osg::Object::DYNAMIC);
}
if (nifNode->boneTrafo || nifNode->boneIndex != -1)
if (nifNode->isBone)
dataVariance = osg::Object::DYNAMIC;
break;

Loading…
Cancel
Save