|
|
@ -935,8 +935,10 @@ namespace MWRender
|
|
|
|
|
|
|
|
|
|
|
|
void Animation::setObjectRoot(const std::string &model, bool forceskeleton, bool baseonly, bool isCreature)
|
|
|
|
void Animation::setObjectRoot(const std::string &model, bool forceskeleton, bool baseonly, bool isCreature)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::StateSet> previousStateset;
|
|
|
|
if (mObjectRoot)
|
|
|
|
if (mObjectRoot)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
previousStateset = mObjectRoot->getStateSet();
|
|
|
|
mObjectRoot->getParent(0)->removeChild(mObjectRoot);
|
|
|
|
mObjectRoot->getParent(0)->removeChild(mObjectRoot);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mObjectRoot = NULL;
|
|
|
|
mObjectRoot = NULL;
|
|
|
@ -961,6 +963,9 @@ namespace MWRender
|
|
|
|
mObjectRoot = newObjectRoot;
|
|
|
|
mObjectRoot = newObjectRoot;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (previousStateset)
|
|
|
|
|
|
|
|
mObjectRoot->setStateSet(previousStateset);
|
|
|
|
|
|
|
|
|
|
|
|
if (baseonly)
|
|
|
|
if (baseonly)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
RemoveDrawableVisitor removeDrawableVisitor;
|
|
|
|
RemoveDrawableVisitor removeDrawableVisitor;
|
|
|
|