I▓ve got the following question:

How do I extract the animations from the exported (OSG)file. 

The code (FAQ OsgExp for 3DMAX)  not work: 
What exactly should be changed?




std::vector(osg::PositionAttitudeTransform*) _cameras;
std::vector(osg::Switch*) _switches;
std::vector(osg::AnimationPathCallback*) _animations;

/**
 * Find all special nodes in the scenegraph.
 */
void Previewer::findSpecialNodes(osg::Node* node){
 // Find animations
 if(dynamic_cast(osg::AnimationPathCallback*) (node->getUpdateCallback())){
  _animations.push_back(dynamic_cast(osg::AnimationPathCallback*) 
(node->getUpdateCallback())->getAnimationPath());
 }
 // Find cameras
 if(dynamic_cast(osg::PositionAttitudeTransform*) (node)){
  _cameras.push_back(static_cast(osg::PositionAttitudeTransform*) (node));
 }
 // Find switches
 else if(dynamic_cast(osg::Switch*) (node)){
  _switches.push_back(static_cast(osg::Switch*) (node));
 }
 // Traverse any group node
 else if(dynamic_cast(osg::Group*) (node)){
  osg::Group* group = static_cast(osg::Group*) (node);
  for(unsigned int i=0; igetNumChildren(); i++)
   findSpecialNodes(group->getChild(i));
 }
}

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to