viewer.addEventHandler(osgViewer.StatsHandler)() viewer.addEventHandler(osgViewer.ThreadingHandler)() configfile = str() while arguments.read("--config", configfile) : osg.notify(osg.NOTICE), "Trying to read config file ", configfile object = osgDB.readObjectFile(configfile) view = dynamic_cast<osgViewer.View*>(object) if view : osg.notify(osg.NOTICE), "Read config file succesfully" else: osg.notify(osg.NOTICE), "Failed to read config file : ", configfile return 1 while arguments.read("--write-config", configfile) : osgDB.writeObjectFile(viewer, configfile) if arguments.read("-m") : modelHandler = ModelHandler() for(int i=1 i<arguments.argc()++i) modelHandler.add(arguments[i]) viewer.addEventHandler(modelHandler) else: # load the scene. loadedModel = osgDB.readNodeFiles(arguments) if not loadedModel : loadedModel = osgDB.readNodeFile("cow.osgt") if not loadedModel :
nframes = static_cast<unsigned int>(ceil(duration/fps)) else # duration == 0.0 if fps==0.0 : fps=60.0 if nframes==0 : nframes=1 duration = static_cast<double>(nframes)/fps fc.setNumberOfFrames(nframes) fc.setFrameRate(fps) OSG_NOTICE, "Duration=", duration, ", FPS=", fps, ", Number of Frames=", nframes if arguments.read("--output-cs",filename) : osgDB.writeObjectFile(*fc, filename) return 1 if fc.valid() : frameCaptureList.push_back(fc) if frameCaptureList.empty() : OSG_NOTICE, "No settings provided" return 1 # setup viewer ds = osg.DisplaySettings()