exporting four legged skelton animation

toxicmind

13-04-2011 17:07:14

Hello, I hope this forum is still active.

I have searched forums, but I could not find quite matched subject.
I have an animated wolf with the bones showing in the attached image. My wolf is animating fine in 3DS Max, but it is not working in OGRE after exporting oFusion.

In 3DSMax;
I used Skin modifier to weight, but all other controllers are not added. IK on legs and a tail.

In OGRE;
The wolf seems to have animation. However, all four legs are off the ground and squashed into the body. It looks like the wolf got weight messed up on legs.
Also I have several animations exported, idle, walk, run, etc. But only the idle animation is showing.

I have a human character with biped animation, and all animation on him works fine.

What can I do to fix the problem, or does my programmer has to do anything in OGRE?


Thanks.

Lioric

16-04-2011 19:41:28

What version are you using to export your animations?

How is the animation shown in the preview viewport?

Is the character made of a single mesh or multiple separated meshes?

If made of multiple meshes, are all of the bones from the skeleton added to each object's skin bones list?

It should not be any different if you export a four legged skeleton or any other type (we have seen characters made of several extremities, from our users, exported as any other character type, without any difference)

toxicmind

18-04-2011 17:22:37

Lioric,

Thank you for your reply.
I am using oFusion pro 1.973 with 3DSMax 2010.
My animation looks fine in Max viewport, but it looks way I described above in oFusion preview in Max.
It is single mesh.

I didn't mess around with the biped for my character much, but I tweaked a lot on the bone settings of my wolf, especially on legs.

I am going through IK settings on legs to figure it out, but please let me know if you or anybody else happen to know a solution to this problem.

Thank you very much.

Lioric

18-04-2011 18:17:10

It would be good if you can install the latest hotfix (#384oECM from December 26, 2010), to be sure you are working with the latest fixes in skeletal animation

IK are fully supported

You might want to review that your character has a single root object
Additionally review if any of the legs (or any other bones) is a mirrored bone, that type of bone is not supported, because of performance reasons at runtime

You might want to "clean the object matrix", see this thread:

http://www.ogre3d.org/addonforums/viewtopic.php?f=5&t=5541&hilit=clean+matrix

Sometimes that issue can be caused by a non clean matrix, during the object creation process (modeling and bone assignment), some internal matrices are used that might not be optimal for interactive engines as Ogre, for performance those matrices needs to be converted, there are cases where max uses some additional internal matrices in the skin modifier and that might produce a different result (what you are experiencing), to solve this you need to clean the matix of the animated mesh object

The faster and safer way is using the "box trick", you create an axis aligned box, attach the animated object to this, then remove the box, this cleans the object matrix to an "identity" state (a matrix that dont modify the object)

The envelopes of the skin modifier must be saved before this process and loaded after to set the vertex assignments

See these videso for detailed instructions on this procedure:

http://www.ofusiontechnologies.com/videos/mozzyCleanMatrix156.avi
*Mozzy model property of CNotifor, courtesy of CNotifor

http://www.ofusiontechnologies.com/videos/firemanVideo5.avi
*Fireman model property of Fraunhofer FIT , courtesy of Fraunhofer FIT

toxicmind

18-04-2011 19:33:04

Thank you very much for new instructions!
I am trying "box trick" right now.
I do have the latest hotfix.

I am not an animator and I probably made some painful mistakes here...

Thank you very for your help, Lioric.
I will try all your suggestions, and I might ask you more questions later if you don't mind.

toxicmind

18-04-2011 20:54:40

Lioric,

I tried "box trick" and reset scale in Hierarchy, but didn't work.
I am actually very confident that my mesh object is not problem. I always make sure to keep my mesh clean.
However, all the animation part, bones, helpers, etc, I am not sure how clean they are.

I am very sure I did Not reset xform. And you are right, I did mirror bones on legs.

If mirroring is an issue, and I have to reset xform, that means I have to start from scratch?

"To clean the matrix, the faster method is to reset the xform from the object (bone or helpers) "before" adding it to the skel hierarchy"

Does this mean I have to reset the xform before I link bones and other control?

I was hoping for not falling into the worst case scenario, but it seems I am...

Thank you very much for your help. I learned my lesson.

Lioric

19-04-2011 16:44:17

Does this mean I have to reset the xform before I link bones and other control?

Actually 99% of the time you don't need to modify anything about bones (matrix related), its just the occasions where the bones where mirrored or transformed in some "non-standard" ways, but in this instances its highly recommended (and faster) to just recreate it with a "clean" bone (non mirrored, and non scaled or transformed with some obscure modifiers)

What is of great importance is the initial pose (figure mode), sometimes users tend to have the initial pose in a very different place/rotation/scale from the start of the animation, this might cause this type of issues and will cause more when trying to blend between different animations

A good rule is to have all animations to seamless start from the initial pose (as in the root bone in the same place/scale/rotation)

If mirroring is an issue, and I have to reset xform, that means I have to start from scratch?

You don't need to start from scratch, and most of the time it will take just a few minutes if you use maxscript (probably already there is a script that can do this somewhere), just create a "clean" similar bone, align to the old mirrored bone, copy its keyframes and replace the mirrored bone with this new bone in the skeleton (and use the old bone vertex assignments in the skin modifier), all this can be automated with maxscript (even you can automatically search for mirrored bones in all of your scene objects and apply this process transparently)

and I might ask you more questions later if you don't mind

Of course, I will be more than glad to help our users in any possible way

toxicmind

21-04-2011 20:48:02

Wow, thank you very much for great advices, Lioric!
I have not tried yet, but I am so glad that I may not have to start over again.