Exporting hierarchical (linked) animations

instbldrjems

21-01-2009 22:29:54

Hi --

I want to export a linked animation from MAX, i.e. object a is parented to object b etc. Here's the scenario:

I have a shipping crate, with a lid that opens when a rear hinge connecting the lid to the base is animated. Inside the lid is foam, and inside the foam are various objects. The foam and objects are parented to the hinge also, so they all move together. When the lid is fully open the objects move up and out of the foam. While the "up and out" motion of the objects is keyframed and I know how to set that up in oFusion, I'm not sure how I should handle the parented motion of the objects. If I remember rightly you used to be able to "bake" any kind of procedural animation into keyframes in earlier versions of Max, but I can't find this capability any more (I'm using Max 2009).

Any help or suggestions would be greatly appreciated.

Thanks.

Lioric

22-01-2009 15:55:34

There is no need to bake the animation into keyframes, this is all supported by oFusion, have you tested this in the preview viewport? is the animation not correctly displayed or exported?

Evak

22-01-2009 17:44:08

I seem to recall that the heirarchicly linked node animation is handled differently than other ogre animations. If what your doing is freeform animation with seperate meshes linked together with simple heirarchy rather than bones.


If you are doing Node animation Ofusion creates the tracks and stores the animation data in the OSM file, Ogre doesn't have node animation without bones. So you have to grab the animation data stored in the OSM and animate it. I can't remember all the details but our coder said that the animation came out all wrong unless you reset every frame and then apply the new transform. Otherwise the animation works in an odd unpredictable way. So if you get odd results it probably means that your almost there, just need to reset each frame and apply elapsed time to stop the animation drifting.

Lioric

22-01-2009 19:58:20

The node animation produced in the OSM scene file is created in a way that let you use the animation in any order that you need, lets suppose that you want to animate and object starting from the 1.5secs of the object animation (because that is when the object is displayed in your scene), you get the node, reset the state and apply the current 1.5secs anim (just the single keyframe at that time), that is why you reset the node state before applying the current keyframe, its not odd, but suppose that the keyframes were progressive and need each other (all of the previous keyframes) then you would need to reset the object state, and loop for every single keyframe adding it up to the total for all keys before 1.5secs, then apply this "added" keyframe to the current object position

This is just some information on how the keyframes are used internally by Ogre, all this is automatic and you dont need to handle it manually, ususally you will use an "AnimationState" object and just call the "update" method each frame

There are several threads with more details and code to animate (automatically or manually) your node objects

instbldrjems

23-01-2009 15:42:39

Hi --

Thanks for your collective replies. Actually, I've been successfully exporting node animation clips and using them in my simulation engine for a while now, so the basic process is familiar to me. However this is the first time I've tried to do a compound (i.e. linked) animation such as this and export it to Ogre. Normally I will make discrete events for each animation, so they can be triggered manually. We are typically taking scenes that were animated "traditionally" in MAX (i.e. in linear fashion) and demonstrating the advantages of the non-linear animation approach possible in a realtime engine.

I guess my basic problem is I'm not sure how to set up the clips in the Object Animation List Editor for the objects in question. Normally I would name the motion and set the start and end frames to match the object's start and end keyframes. But in this case, the object's movement for the first 500 frames of the original animation is driven by the animation of its parent, so there are no actual keyframes for this object until after frame 500. So should I define the start of this object's motion to include the parent's motion, i.e. include the first 500 frames? It doesn't seem to work when I export it like that, but it's not working when I set the start and end to be the object's actual keyframes either.

I realize I may need to modify my code to handle a more complex animation situation, but it would help to know the correct way to set this up for export using oFusion.

Thanks.

Lioric

23-01-2009 21:24:36

If you could send us a sample scene for this issue we will take a look at it and suggest you the best setup, or add the support if it is not already implemented, for your particular needs