diff --git a/src/osgUtil/Optimizer.cpp b/src/osgUtil/Optimizer.cpp index f4ea29fde..f93f6ae5f 100644 --- a/src/osgUtil/Optimizer.cpp +++ b/src/osgUtil/Optimizer.cpp @@ -274,6 +274,20 @@ void Optimizer::optimize(osg::Node* node, unsigned int options) } + if (options & REMOVE_REDUNDANT_NODES) + { + OSG_INFO<<"Optimizer::optimize() doing REMOVE_REDUNDANT_NODES"<accept(renv); + renv.removeEmptyNodes(); + + RemoveRedundantNodesVisitor rrnv(this); + node->accept(rrnv); + rrnv.removeRedundantNodes(); + + } + if (options & MERGE_GEODES) { OSG_INFO<<"Optimizer::optimize() doing MERGE_GEODES"<accept(renv); - renv.removeEmptyNodes(); - - RemoveRedundantNodesVisitor rrnv(this); - node->accept(rrnv); - rrnv.removeRedundantNodes(); - - } - if (options & FLATTEN_BILLBOARDS) { FlattenBillboardVisitor fbv(this);