diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index bd4caeab8..219b08135 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -1097,7 +1097,7 @@ void Optimizer::FlattenStaticTransformsVisitor::apply(osg::Geode& geode) for(unsigned int i=0;iasGeometry(); - if(geometry) + if((geometry) && (isOperationPermissibleForObject(&geode)) && (isOperationPermissibleForObject(geometry))) { if(geometry->getVertexArray() && geometry->getVertexArray()->referenceCount() > 1) { geometry->setVertexArray(dynamic_cast(geometry->getVertexArray()->clone(osg::CopyOp::DEEP_COPY_ALL)));