mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 07:53:52 +00:00
Check existing skeleton sources if the current one has no animation root
This commit is contained in:
parent
16933e3926
commit
054ef3113a
1 changed files with 19 additions and 1 deletions
|
@ -108,10 +108,28 @@ void Animation::createEntityList(Ogre::SceneNode *node, const std::string &model
|
|||
boneiter.getNext()->setManuallyControlled(true);
|
||||
|
||||
Ogre::Bone *bone = insertSkeletonSource(skelinst->getName());
|
||||
if(!bone)
|
||||
{
|
||||
for(std::vector<Ogre::SkeletonPtr>::const_iterator iter(mSkeletonSources.begin());
|
||||
!bone && iter != mSkeletonSources.end();iter++)
|
||||
{
|
||||
Ogre::Skeleton::BoneIterator boneiter = (*iter)->getBoneIterator();
|
||||
while(boneiter.hasMoreElements())
|
||||
{
|
||||
bone = boneiter.getNext();
|
||||
Ogre::UserObjectBindings &bindings = bone->getUserObjectBindings();
|
||||
const Ogre::Any &data = bindings.getUserAny(NifOgre::sTextKeyExtraDataID);
|
||||
if(!data.isEmpty() && Ogre::any_cast<bool>(data))
|
||||
break;
|
||||
|
||||
bone = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(bone)
|
||||
{
|
||||
mAccumRoot = mInsert;
|
||||
mNonAccumRoot = skelinst->getBone(bone->getHandle());
|
||||
mNonAccumRoot = skelinst->getBone(bone->getName());
|
||||
|
||||
mStartPosition = mNonAccumRoot->getInitialPosition();
|
||||
mLastPosition = mStartPosition;
|
||||
|
|
Loading…
Reference in a new issue