From 13a7ecebdeaf930fbcf396ff89ee7bc2e3623d60 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 9 Sep 2009 13:23:49 +0000 Subject: [PATCH] Added support for "--output filename.osg" command line option to avoid debugging of generated presentations --- applications/present3D/present3D.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/applications/present3D/present3D.cpp b/applications/present3D/present3D.cpp index ae478523b..ba740edb2 100644 --- a/applications/present3D/present3D.cpp +++ b/applications/present3D/present3D.cpp @@ -576,6 +576,10 @@ int main( int argc, char **argv ) osg::DisplaySettings::instance()->setScreenWidth(width); } + std::string outputFileName; + while(arguments.read("--output",outputFileName)) {} + + // get details on keyboard and mouse bindings used by the viewer. viewer.getUsage(*arguments.getApplicationUsage()); @@ -779,8 +783,12 @@ int main( int argc, char **argv ) seh->selectSlide(0); seh->home(); - - // osgDB::writeNodeFile(*loadedModel,"saved.osg"); + + if (!outputFileName.empty()) + { + osgDB::writeNodeFile(*loadedModel,outputFileName); + return 0; + } osg::Timer_t startOfFrameTick = osg::Timer::instance()->tick(); double targetFrameTime = 1.0/targetFrameRate;