Page 1 of 1

Sharing animations between skeletons

Posted: Fri Jun 14, 2013 8:26 pm
by sparkprime
Basically the problem is there are n robot meshes that have a similar bipedal structure, share the same set of bones with the same hierarchy, but have a different binding pose due to e.g. being larger/smaller or having longer/shorter legs, etc. In Ogre today, each robot needs its own .skeleton file because the binding pose is different.

With careful design of animations, it is possible to create e.g. a walk animation that can be used with all of the robots. You do this by e.g. only rotating the bones about their local origins, and avoiding translation of bones. This way, differences in the skeleton don't affect the validity of the animation, e.g. changing the length of a bone from one robot to another does not matter.

This means it should be possible to maintain a couple of dozen animations for all the different things a robot can do, and use them on all the robots. Furthermore, these need only exist once on disk, and can therefore be exported once and tested on all robot meshes.

At the moment this is not possible in Ogre because the animations are associated with the skeleton. This is *not* how it is done in UDK, Unity, and Crysis. Typically the skeleton (i.e. the list of bones, the hierarchy, and the binding pose) is stored in the same file as the mesh (i.e. no sharing of that is possible), but the animations are in a separate file and those can be shared. I have also some experience reverse-engineering GTA SA and there, it is the same -- the meshes (.dff files) contain the skeleton and there are separate files (.ifp files) that contain the animations, which are reused across a wide range of different meshes.

It seems this is a case of Ogre doing one thing, and everyone else in the industry doing another thing. Furthermore, the thing that Ogre is doing is not very helpful since it doesn't allow sharing of animations in this way. I think I will need to address it in my engine one way or the other. But I wondered if anyone on here has an opinion?

Here's an old thread that mentions this subject

Re: Sharing animations between skeletons

Posted: Sat Jun 15, 2013 3:20 am
by mkultra333
I do this in my project. I have one mesh, just a cube, with a humanoid skeleton and bunch of humanoid animations. Then I have my various humanoid monsters with their skeletons and just a standing pose for an animation. None of the skeletons really match one-to-one but have rough correspondences. I do the retargetting frame by frame for each monster and manually control the animation parameters.

It'd be an interesting feature if it were a part of Ogre, especially the skeleton re-targetting.

Re: Sharing animations between skeletons

Posted: Mon Oct 21, 2013 1:37 pm
by dark_sylinc
At least in the animation system I'm designing for 2.0; this should be possible (as long as the skeletons share the exact same hierarchy structure, they can have any other position/rotation/scale you want)

All it would take is that SkeletonDef::mAnimationDefs should become a pointer shared across all SkeletonDef. It's good to read about this feature. I agree it's useful and important.

Btw, I think Ogre 1.x does have a separation of Animation - Bone systems. Try sharing the pointers in Skeleton::mAnimationsList across different skeletons. That should do it.
In fact I'm seeing a function called "addLinkedSkeletonAnimationSource" which seems to do exactly this.