mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-28 20:06:41 +00:00
Get the animation controller target names
This commit is contained in:
parent
c2acf47d88
commit
0986cd5962
1 changed files with 18 additions and 0 deletions
|
@ -195,9 +195,27 @@ void loadResource(Ogre::Resource *resource)
|
||||||
std::vector<Nif::NiKeyframeController*> ctrls;
|
std::vector<Nif::NiKeyframeController*> ctrls;
|
||||||
buildBones(skel, node, ctrls);
|
buildBones(skel, node, ctrls);
|
||||||
|
|
||||||
|
std::vector<std::string> targets;
|
||||||
// TODO: If ctrls.size() == 0, check for a .kf file sharing the name of the .nif file
|
// TODO: If ctrls.size() == 0, check for a .kf file sharing the name of the .nif file
|
||||||
if(ctrls.size() == 0) // No animations? Then we're done.
|
if(ctrls.size() == 0) // No animations? Then we're done.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
float maxtime = 0.0f;
|
||||||
|
for(size_t i = 0;i < ctrls.size();i++)
|
||||||
|
{
|
||||||
|
Nif::NiKeyframeController *ctrl = ctrls[i];
|
||||||
|
maxtime = std::max(maxtime, ctrl->timeStop);
|
||||||
|
Nif::Named *target = dynamic_cast<Nif::Named*>(ctrl->target.getPtr());
|
||||||
|
if(target != NULL)
|
||||||
|
targets.push_back(target->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(targets.size() != ctrls.size())
|
||||||
|
{
|
||||||
|
warn("Target size mismatch ("+Ogre::StringConverter::toString(targets.size())+" targets, "+
|
||||||
|
Ogre::StringConverter::toString(ctrls.size())+" controllers)");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool createSkeleton(const std::string &name, const std::string &group, Nif::Node *node)
|
bool createSkeleton(const std::string &name, const std::string &group, Nif::Node *node)
|
||||||
|
|
Loading…
Reference in a new issue