Page 1 of 1

Problem with Milkshape exported animations

Posted: Tue Apr 05, 2005 10:00 pm
by Krulspeld
I exported a Milkshape animated model with the Ogre exporter, but only some of the animations can be used. The rest of the animations in the mesh cause my application to crash. This also happens when activating one of these evil animations from the Ogre meshviewer. As I said there are animations that work OK. The MS model (not mine) I tried to export can be found here and is the dwarf.
http://www.psionic3d.co.uk/cgi-bin/imag ... D%20Models

Posted: Mon Apr 11, 2005 9:06 am
by Krulspeld
The problem seems to be caused by a separate bone that is used to attach the camera to. It's not part of the character skeleton and there are no vertices attached to it. Removing this bone 'solves' the problem.

There still seems to exist another problem with the Milkshape exporter. Not all bone rotations will export correctly. When looking at the animations in the ninja mesh that is included with ogre, the stealthy walk animation and the backflip go wrong.

Posted: Mon Apr 11, 2005 1:47 pm
by sinbad
I suspect this might be because of the 'shortest path' interpolation OGRE uses by default. This is generally the expected default on most modellers, since you can't properly animate things like a repeating 360 degree spin without it. It does, however, mean that you cannot key rotations more than 180 degrees apart. Some people might key a 270 degree rotation, for example, and find that it actually goes -90 degrees. It's easy to resolve just by adding an extra keyframe. The 'repeating spin' problem is not resolvable without the shortest path approach, however, which is why we use it.

Posted: Mon Apr 11, 2005 3:37 pm
by Krulspeld
So maybe it would be wise to let the Milkshape exporter insert extra keyframes if it discovers rotation values larger than 180 degrees. How about this as a user option?

Posted: Mon Apr 11, 2005 5:21 pm
by sinbad
I guess that's an option. I have my hands full with XSI right now though, patches are welcome if you want to have a go.

I have the same problem

Posted: Tue Oct 04, 2005 4:57 pm
by Buckcherry
Hello,

I have exactly the same problem as you. I am using even the same model (the dwarf).

Could you tell me if you solve it and how, please?.

Thanks a lot.

Posted: Tue Oct 04, 2005 8:43 pm
by Krulspeld
As said above first remove the separate camera bone in Milkshape.

Here is the animation file I am using.

Code: Select all

2,14,Walk
16,26,Run
28,40,Jump
42,54,JumpSpot
56,59,CrouchDown
60,69,StayCrouched
70,74,GetUp
75,88,BattleIdle1
90,110,BattleIdle2
112,126,AttackSwipeAxe
128,142,AttackJump
144,160,Attack360Spin
162,180,Attack2Swipes
182,192,AttackStab
194,210,Block
212,227,DieForwards
230,251,DieBackwards
253,272,NodYes
274,290,ShakeNo
292,325,Idle1
327,360,Idle2

More problems

Posted: Tue Oct 04, 2005 10:48 pm
by Buckcherry
Hello again,

Thank you very much for that, but I have created a file with the same code as you and when I open the .mesh with the OgreMeshViewer the animations are not well defined, and the name that shows do not correspond with the animation shown...

Do you know what is wrong?.

Thank you again.

More things

Posted: Wed Oct 05, 2005 2:54 pm
by Buckcherry
Hello again,

I solved the problem with the animations. I just downloaded the model again and I exported to .mesh format.

The problem now is that I can not load the animations using Ogre. I have used the source code from Intermediate Tutorial 1 and with the Robot model it works perfectly, but when I changed it to the Dwarf model it crashes. It makes a "bong" and I can only see a blank window. Pressing ESC I exit.

Anybody knows what is wrong?.

Thanks.

Posted: Fri Oct 07, 2005 7:49 pm
by Krulspeld
Did you remove the 'cam' joint in Milkshape as I suggested earlier in this topic? This joint is totally separate from all other joints and might be the cause of the problems you experience.

A solution (sort-of)

Posted: Mon Oct 10, 2005 6:57 pm
by ScurvyKnave
Yes. I've had exactly the same problem, using that dwarf model and tons of others. It must be a bug with the Milkshape exporter. I eventually manage to get them working though, but it's a painstakingly annoying process. What you have to do is run through the model in milkshape, clicking the 'Set as keyframe' button on each keyframe all over again. Then it should work, if you remember them all. Also, just to be safe, do them in order, from start to finish.

Hopefully that works (it does usually, though not always). Once you've exported a working model for that mesh, it usually works afterwards even if you export it again after having made changes.

About the bong!

Posted: Mon Oct 10, 2005 7:00 pm
by ScurvyKnave
If you hear a bong, and the screen stays black, Ogre couldn't find one of the resources. Exit, and check the log (called "Ogre.txt" I think). Near the bottom it'll say "exception thrown" and tell you why.

Remember, if you're using a different mesh, it will have different animations, and different names for them, so you'll obviously have to modify the code to take that into account.

Posted: Thu Oct 27, 2005 4:46 am
by SteveSheppard
Ok, I'm glad to know this is a known issue, this was driving me insane. What I didn't totally understand was that when I encountered this issue (specific animations crashing the program) it was happening with my idle animation which had no vast variation in angles, in fact, none of the bones move. I added the additional key frames and it works though.

Ogre is awesome by the way.