Hi Phil, I would write a custom Registry::ReadFileCallback that loads the models using the standard Registry::readFileImplementation() way and then runs a custom visitor on the loaded model before returning this model to application.
The custom visitor would look for nodes in the scene graph that are animated and then toggle their state to the state you want, and potentially add extra callbacks or mapping so that you application can keep track of these animating nodes. Robert. On Wed, May 20, 2009 at 9:20 PM, Philip Lamb <[email protected]> wrote: > Hi all, > > Apologies if the answer to this question should be self-evident, but I'm > having some trouble implementing a solution for pausing, restarting, > resetting and detecting the end of animations contained in a subgraph read > in via osgDB. > > Basically, I have some models with animations embedded (exported from 3DS > Max via osgExp plugin for Max) and I load these in via osgDB. What I want to > do is provide a set of controls to start the animations, pause them while in > progress, resume them from pause, and then get a callback (or detect via > some other means) when they've finished running. > > My idea in general was to use a keyboard handler which then creates a node > visitor, asks the models to accept the visitor, and then in the visitor I > change some state. Any hints on whether this is the recommended approach, > and how to actually implement it gladly welcomed. > > Regards, > Phil. > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

