How can we share generic animations between models ?

adonf

21-02-2007 12:17:53

Hi

Most models in our project share the same biped structure and we have a lot of animations, so we need to export generic .skeleton files and reuse them between our models, but we can't figure out if this is possible with Ofusion or maybe event Ogre. For example we want to be able to load and use walk.skeleton with either models bob.mesh or ted.mesh

We were able to export several .skeleton files for a single model and play them on the .mesh files that was exported with one of them. It kinda works but not always. I believe that it depends if frames 0 of both animations are similar or not, but that's just a guess.

On the other hand if we try to play walk.skeleton on bob.mesh when the .skeleton was exported along with the Ted model, the resulting animation is just broken: the skinning is still good but the animation doesn't look at all like it should. Again, Bob and Ted have the same biped structure and the walk animation works with both models in MAX

I know that the Pro version lets users save animations in .anim files, but I'm not sure if this would solve our problem.

Any suggestions ?

Thanks,
Olivier

pnyx

21-02-2007 12:59:42

Hi
I'm no expert but if the bones of both skeletons are in same order and have the same ids it should work.
I created several bodyparts and clothing for an Character Generation for an RPG that all share the same .skeleton file. All I had to do was to change the skeleton tag in the mesh.xml by hand, and it works fine...

adonf

21-02-2007 13:46:21

Thanks, we're going to try what you suggested. It's not really what we want to do but it might help us get a better grasp of the problem.

edit: By the way, how do you get the .XML files with ofusion ? All we can find are the binary .mesh and .skeleton...
edit2: got it, XMLconverter.EXE works both ways...

adonf

21-02-2007 14:46:32

update:

So we've exported two sets of (mesh + skeleton), one for each character using the walk animation, then converted those back to XML and run a diff tool on the .skeleton.xml files, and we've found some odd results:

- the bones IDs are different
- the source positions, rotations and axes of the bones are different
- the keyframes are different

Basically we get two completely different, non-compatible animations when our source files had the same bone hierarchy and shared the same .BIP animation file.

Any ideas what's going on ?

Olivier

Lioric

21-02-2007 16:07:55

In the current Pro version, you can automatically define the bone IDs of your characters, with the "Set Bone Handle" tool (or set the "_SK_HANDLE" property for each bone object in CE version, i.e. _SK_HANDLE=1)

If you are using the CE version, then in the update that will be released on this week, the skeletal bones will be sorted by name, this will result in similar skeletons for all your characters that has the same bone structure, and you can share your animations very easy without convering to XML

The animation is produced using the "Figure Mode" (if phy mod is used) or the "Pose Mode" (if skin mod) as the "Binding Pose" or the base of the animations, if your characters uses a similar base pose, then any animation will be compatible

adonf

21-02-2007 16:44:42

Thanks for your answer, Lioric. We'll definitely try the next version.

But there's one point that I don't think it will solve: When we read through the XML files we saw that in a .skeleton file the bones' default positions and orientations are those from frame 0 (so that all frames 0 have no scale, position or orientation factors). I believe that when we load several .skeleton files on the same mesh, it always uses the initial position and orientation of the main . skeleton (ie. the one that is linked from the .mesh file), so if our additional animations don't have the same start pose as the main one, they will not be played correctly.

Am I right to assume that ? Is there something to be done about it ? Can we configure oFusion so that it sets the initial position of all bones in the animation's frame 0 and not in the bone's definition section ?

Thanks.
Olivier