mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +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)
|
||||
{
|
||||
if(!mEntityList.mSkelBase)
|
||||
return;
|
||||
|
||||
Ogre::SkeletonManager &skelMgr = Ogre::SkeletonManager::getSingleton();
|
||||
|
||||
mCurrentAnim = NULL;
|
||||
@ -59,7 +62,7 @@ void Animation::setAnimationSources(const std::vector<std::string> &names)
|
||||
mSkeletonSources.clear();
|
||||
|
||||
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);
|
||||
if(skel.isNull())
|
||||
@ -69,7 +72,6 @@ void Animation::setAnimationSources(const std::vector<std::string> &names)
|
||||
if(skel.isNull())
|
||||
{
|
||||
std::cerr<< "Failed to get skeleton source "<<*nameiter <<std::endl;
|
||||
nameiter++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -84,7 +86,7 @@ void Animation::setAnimationSources(const std::vector<std::string> &names)
|
||||
if(data.isEmpty() || !Ogre::any_cast<bool>(data))
|
||||
continue;
|
||||
|
||||
if(!mNonAccumRoot && mEntityList.mSkelBase)
|
||||
if(!mNonAccumRoot)
|
||||
{
|
||||
mAccumRoot = mInsert;
|
||||
mNonAccumRoot = mEntityList.mSkelBase->getSkeleton()->getBone(bone->getName());
|
||||
@ -102,8 +104,6 @@ void Animation::setAnimationSources(const std::vector<std::string> &names)
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
nameiter++;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user