mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
Don't create an unnecessary osg::Group when copying over a rig
This commit is contained in:
parent
36bb255bc0
commit
1e5b4bea0a
@ -56,10 +56,19 @@ namespace SceneUtil
|
|||||||
CopyRigVisitor copyVisitor(handle, filter);
|
CopyRigVisitor copyVisitor(handle, filter);
|
||||||
toAttach->accept(copyVisitor);
|
toAttach->accept(copyVisitor);
|
||||||
|
|
||||||
|
if (handle->getNumChildren() == 1)
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osg::Node> newHandle = handle->getChild(0);
|
||||||
|
handle->removeChild(newHandle);
|
||||||
|
master->asGroup()->addChild(newHandle);
|
||||||
|
return newHandle;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
master->asGroup()->addChild(handle);
|
master->asGroup()->addChild(handle);
|
||||||
|
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FindByNameVisitor find(attachNode);
|
FindByNameVisitor find(attachNode);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user