mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 21:40:03 +00:00
Don't set animation sources for models that don't have a skeleton
This commit is contained in:
parent
0148db8ccf
commit
0d0e75fe0b
@ -49,6 +49,9 @@ Animation::~Animation()
|
|||||||
|
|
||||||
void Animation::setAnimationSources(const std::vector<std::string> &names)
|
void Animation::setAnimationSources(const std::vector<std::string> &names)
|
||||||
{
|
{
|
||||||
|
if(!mEntityList.mSkelBase)
|
||||||
|
return;
|
||||||
|
|
||||||
Ogre::SkeletonManager &skelMgr = Ogre::SkeletonManager::getSingleton();
|
Ogre::SkeletonManager &skelMgr = Ogre::SkeletonManager::getSingleton();
|
||||||
|
|
||||||
mCurrentAnim = NULL;
|
mCurrentAnim = NULL;
|
||||||
@ -59,7 +62,7 @@ void Animation::setAnimationSources(const std::vector<std::string> &names)
|
|||||||
mSkeletonSources.clear();
|
mSkeletonSources.clear();
|
||||||
|
|
||||||
std::vector<std::string>::const_iterator nameiter = names.begin();
|
std::vector<std::string>::const_iterator nameiter = names.begin();
|
||||||
while(nameiter != names.end())
|
for(nameiter = names.begin();nameiter != names.end();nameiter++)
|
||||||
{
|
{
|
||||||
Ogre::SkeletonPtr skel = skelMgr.getByName(*nameiter);
|
Ogre::SkeletonPtr skel = skelMgr.getByName(*nameiter);
|
||||||
if(skel.isNull())
|
if(skel.isNull())
|
||||||
@ -69,7 +72,6 @@ void Animation::setAnimationSources(const std::vector<std::string> &names)
|
|||||||
if(skel.isNull())
|
if(skel.isNull())
|
||||||
{
|
{
|
||||||
std::cerr<< "Failed to get skeleton source "<<*nameiter <<std::endl;
|
std::cerr<< "Failed to get skeleton source "<<*nameiter <<std::endl;
|
||||||
nameiter++;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -84,7 +86,7 @@ void Animation::setAnimationSources(const std::vector<std::string> &names)
|
|||||||
if(data.isEmpty() || !Ogre::any_cast<bool>(data))
|
if(data.isEmpty() || !Ogre::any_cast<bool>(data))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(!mNonAccumRoot && mEntityList.mSkelBase)
|
if(!mNonAccumRoot)
|
||||||
{
|
{
|
||||||
mAccumRoot = mInsert;
|
mAccumRoot = mInsert;
|
||||||
mNonAccumRoot = mEntityList.mSkelBase->getSkeleton()->getBone(bone->getName());
|
mNonAccumRoot = mEntityList.mSkelBase->getSkeleton()->getBone(bone->getName());
|
||||||
@ -102,8 +104,6 @@ void Animation::setAnimationSources(const std::vector<std::string> &names)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
nameiter++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user