From Stephan Huber, Follows is required to prevent unidented cloning of shared arrays :
"I added some calls to isOperationPermissibleForObject() so I can permit the flattten-pass with my specialized objects in my own code."
This commit is contained in:
parent
7cb1bcbd7d
commit
b5bb541cca
@ -1097,7 +1097,7 @@ void Optimizer::FlattenStaticTransformsVisitor::apply(osg::Geode& geode)
|
|||||||
for(unsigned int i=0;i<geode.getNumDrawables();++i)
|
for(unsigned int i=0;i<geode.getNumDrawables();++i)
|
||||||
{
|
{
|
||||||
osg::Geometry *geometry = geode.getDrawable(i)->asGeometry();
|
osg::Geometry *geometry = geode.getDrawable(i)->asGeometry();
|
||||||
if(geometry)
|
if((geometry) && (isOperationPermissibleForObject(&geode)) && (isOperationPermissibleForObject(geometry)))
|
||||||
{
|
{
|
||||||
if(geometry->getVertexArray() && geometry->getVertexArray()->referenceCount() > 1) {
|
if(geometry->getVertexArray() && geometry->getVertexArray()->referenceCount() > 1) {
|
||||||
geometry->setVertexArray(dynamic_cast<osg::Array*>(geometry->getVertexArray()->clone(osg::CopyOp::DEEP_COPY_ALL)));
|
geometry->setVertexArray(dynamic_cast<osg::Array*>(geometry->getVertexArray()->clone(osg::CopyOp::DEEP_COPY_ALL)));
|
||||||
|
Loading…
Reference in New Issue
Block a user