Cannot animate objects

Ichtyostega

19-02-2009 17:48:05

Hi I am a new Ogre user and I installed oFusion to export models and their animation (with Scene Loader Lib).

Exporting meshes, material, and lights works great. I can see them when I run my application. Unfortunately, it is not the case for animation. In 3ds Max, I see the animation when pressing "play". The animation is also there in the OSM file. I can find the animation by calling getAnimation() from the Ogre SceneManager. Calling getAnimationState with the appropriate name or getAllAnimationStates() on the corresponding Entity returns NULL. I wanted to "attach" the animation object to the Entity and the SceneNode, but Ogre does not seem to work this way.

So basically, animation is exported, but it seems to not be "attached" to the node. Am I missing some essential step in the process? I did not find any tutorial on that specific subject and for some unknown reason, the oFusion Pro User's guide is empty when I open it.

Thank you very much for the support!

Lioric

20-02-2009 16:42:51

Search this forums for similar threads, there is no need to call the getAnimation on the entity, as the entity is not aninated at all in Ogre but the node that contains the entity is (an Ogre concept), you get the animation from the scene manager not from the entity (as a single animation can move several different nodes), just get the animation state and enable it and update each frame

In the similar threads of this forums there is code to use all of the animations in the scene or just single animations as needed

Ichtyostega

20-02-2009 18:39:53

Thanks for the answer!

Yes I found too that I could get the animation from the scene manager. I was first mystified because I was following the Ogre tutorial on animation (the one with the robot) and it was getting that animation state from the entity... Anyway, my problem is solved!