mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 22:15:37 +00:00
Don't create an unnecessary osg::Group when copying over a rig
This commit is contained in:
parent
36bb255bc0
commit
1e5b4bea0a
1 changed files with 12 additions and 3 deletions
|
@ -56,9 +56,18 @@ namespace SceneUtil
|
||||||
CopyRigVisitor copyVisitor(handle, filter);
|
CopyRigVisitor copyVisitor(handle, filter);
|
||||||
toAttach->accept(copyVisitor);
|
toAttach->accept(copyVisitor);
|
||||||
|
|
||||||
master->asGroup()->addChild(handle);
|
if (handle->getNumChildren() == 1)
|
||||||
|
{
|
||||||
return handle;
|
osg::ref_ptr<osg::Node> newHandle = handle->getChild(0);
|
||||||
|
handle->removeChild(newHandle);
|
||||||
|
master->asGroup()->addChild(newHandle);
|
||||||
|
return newHandle;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
master->asGroup()->addChild(handle);
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue