mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-27 03:35:27 +00:00
nifloader: attempt to remove redundant root node when a Skeleton is added
This commit is contained in:
parent
2a42c4781e
commit
4d53ab6c32
@ -361,6 +361,18 @@ namespace NifOsg
|
|||||||
if (nif->getUseSkinning())
|
if (nif->getUseSkinning())
|
||||||
{
|
{
|
||||||
osg::ref_ptr<SceneUtil::Skeleton> skel = new SceneUtil::Skeleton;
|
osg::ref_ptr<SceneUtil::Skeleton> skel = new SceneUtil::Skeleton;
|
||||||
|
|
||||||
|
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);
|
skel->addChild(created);
|
||||||
created = skel;
|
created = skel;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user