Problem with Milkshape exported animations

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
Krulspeld
Kobold
Posts: 35
Joined: Tue Apr 05, 2005 9:51 pm

Problem with Milkshape exported animations

Post 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
Krulspeld
Kobold
Posts: 35
Joined: Tue Apr 05, 2005 9:51 pm

Post 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.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post 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.
Krulspeld
Kobold
Posts: 35
Joined: Tue Apr 05, 2005 9:51 pm

Post 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?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post 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.
Buckcherry
Goblin
Posts: 279
Joined: Tue Oct 04, 2005 4:28 pm

I have the same problem

Post 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.
Krulspeld
Kobold
Posts: 35
Joined: Tue Apr 05, 2005 9:51 pm

Post 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
Buckcherry
Goblin
Posts: 279
Joined: Tue Oct 04, 2005 4:28 pm

More problems

Post 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.
Buckcherry
Goblin
Posts: 279
Joined: Tue Oct 04, 2005 4:28 pm

More things

Post 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.
Krulspeld
Kobold
Posts: 35
Joined: Tue Apr 05, 2005 9:51 pm

Post 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.
User avatar
ScurvyKnave
Gremlin
Posts: 150
Joined: Mon Oct 10, 2005 5:57 pm
Contact:

A solution (sort-of)

Post 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.
User avatar
ScurvyKnave
Gremlin
Posts: 150
Joined: Mon Oct 10, 2005 5:57 pm
Contact:

About the bong!

Post 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.
SteveSheppard
Gnoblar
Posts: 18
Joined: Thu Oct 27, 2005 4:25 am
Location: west chester pa

Post 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.
This stuff is awesome
Post Reply