mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
nifloader: attempt to remove redundant root node when a Skeleton is added
This commit is contained in:
parent
2a42c4781e
commit
4d53ab6c32
@ -361,7 +361,19 @@ namespace NifOsg
|
||||
if (nif->getUseSkinning())
|
||||
{
|
||||
osg::ref_ptr<SceneUtil::Skeleton> skel = new SceneUtil::Skeleton;
|
||||
skel->addChild(created);
|
||||
|
||||
osg::Group* root = created->asGroup();
|
||||
if (root && root->getDataVariance() == osg::Object::STATIC)
|
||||
{
|
||||
skel->setStateSet(root->getStateSet());
|
||||
skel->setName(root->getName());
|
||||
for (unsigned int i=0; i<root->getNumChildren(); ++i)
|
||||
skel->addChild(root->getChild(i));
|
||||
root->removeChildren(0, root->getNumChildren());
|
||||
created = skel;
|
||||
}
|
||||
else
|
||||
skel->addChild(created);
|
||||
created = skel;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user