Hello,
I'm testing some solutions and I have an exported animated model (it contains just one animation) that is correctly animated through the animationviewer player.
In my code I just want to play (in loop) that single animation forever, but nothing happens with these lines:
_myModel = osgDB::readNodeFile("my-animated-model.osg");
AnimationManagerFinder finder;
_myModel->accept( finder );
if (finder.AniMan.valid()){
_aniMan = finder.AniMan.get();
_myModel->setUpdateCallback( _aniMan.get() );
const osgAnimation::AnimationList& animations = _aniMan->getAnimationList();
for (unsigned int i=0; i < animations.size(); ++i ){
_aniMan->playAnimation( animations[i] );
printf("Animation %d found\n",i);
animations[i]->setPlayMode( osgAnimation::Animation::LOOP );
}
}
I've did examine animtkviewer example and other, but I'm not able to figure out what's missing to play the animation... maybe somthing really stupid?
Thanks