From 9de43e833fd008a6b5ef7ae955eb8c815f7a89c3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 28 Jun 2004 09:05:33 +0000 Subject: [PATCH] From Bob Kuehne, add additional check in osgconv to handles modules that don't load gracefully. --- examples/osgconv/osgconv.cpp | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/examples/osgconv/osgconv.cpp b/examples/osgconv/osgconv.cpp index 3a1992893..dd3702844 100644 --- a/examples/osgconv/osgconv.cpp +++ b/examples/osgconv/osgconv.cpp @@ -291,21 +291,20 @@ int main( int argc, char **argv ) } osg::ref_ptr root = osgDB::readNodeFiles(fileNames); - - // convert the old style GeoSet to Geometry - ConvertGeoSetsToGeometryVisitor cgtg; - root->accept(cgtg); - // optimize the scene graph, remove rendundent nodes and state etc. - osgUtil::Optimizer optimizer; - optimizer.optimize(root.get()); - - - if( do_convert ) - root = oc.convert( root.get() ); - - if (root.valid()) + if ( root.valid() ) { + // convert the old style GeoSet to Geometry + ConvertGeoSetsToGeometryVisitor cgtg; + if( root.valid() ) root->accept(cgtg); + + // optimize the scene graph, remove rendundent nodes and state etc. + osgUtil::Optimizer optimizer; + optimizer.optimize(root.get()); + + if( do_convert ) + root = oc.convert( root.get() ); + if (osgDB::writeNodeFile(*root,fileNameOut)) { osg::notify(osg::NOTICE)<<"Data written to '"<