Milkshape Exporter Issue. Skeleton or bones screwed.

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
old_man_auz
Greenskin
Posts: 103
Joined: Tue Jun 15, 2004 5:10 am
Location: Australia
x 3

Milkshape Exporter Issue. Skeleton or bones screwed.

Post by old_man_auz »

Hey,

Sorry if there has been a something written about this that I havent found. I have an animated mesh. It plays its animations fine in milkshape. The following screenshot is of my models idle animation.
Image

I can export the the mesh from milkshape to the Ogre mesh format fine. Once I load the mesh into Ogre. It moslty looks right, except that some of the mesh animates incorrectly. Its like some of the bone positions are in an incorrect positions. Here is a screen shot of the same animation above, showing the problem. All the animations exported have the same problem, though some seem worse than others.
Image

Is this my fault or the meshes fault.. What can I do to fix this.

Thanks in advance for any replys.
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 »

Please post the original Milkshape model.
old_man_auz
Greenskin
Posts: 103
Joined: Tue Jun 15, 2004 5:10 am
Location: Australia
x 3

Post by old_man_auz »

is there somewhere I can host the file or can I email it too you ?
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 »

You can mail it to me since I wrote the exporter.
old_man_auz
Greenskin
Posts: 103
Joined: Tue Jun 15, 2004 5:10 am
Location: Australia
x 3

Post by old_man_auz »

I emailed you the file.

Thanks for your help.
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 »

Thanks - I won't get time to look at this until tomorrow night though.
old_man_auz
Greenskin
Posts: 103
Joined: Tue Jun 15, 2004 5:10 am
Location: Australia
x 3

Post by old_man_auz »

Thats fine.. Ive spent a week or two mucking around with it, trying different things, which doesnt mean much becuase my knowledge isnt that great. Im in no rush.
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 »

Hmm, well it's almost impossible to see anything in ms3d since it's just a jumble of bones all on the same spot. Do you have a version which is easier to see the structure?
old_man_auz
Greenskin
Posts: 103
Joined: Tue Jun 15, 2004 5:10 am
Location: Australia
x 3

Post by old_man_auz »

The model is very small.. do you need to zoom in and change the bone size?
I have the bone size set in milkshape to 0.02 ( Under file, preferences, misc, joint size )

I use a scale of 1 unit is equal to 1 metre.

If thats not the problem then let me know.. I can get you a bigger version if you like. I just opened the file I sent you on my computer and it works fine, so I think it works ok.

*update*
I emailed you a bigger version.
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 »

Fixed it now, the bigger version helped - I use Milkshape so little now I didn't remember how to change the bone size. The fix was simple but subtle:

Code: Select all

Index: MilkshapePlugin.cpp
===================================================================
RCS file: /cvsroot/ogre/ogrenew/Tools/MilkshapeExport/src/MilkshapePlugin.cpp,v
retrieving revision 1.43
retrieving revision 1.43.2.1
diff -C2 -d -r1.43 -r1.43.2.1
*** MilkshapePlugin.cpp	11 Mar 2006 15:16:07 -0000	1.43
--- MilkshapePlugin.cpp	15 Apr 2006 16:27:22 -0000	1.43.2.1
***************
*** 1025,1028 ****
--- 1025,1031 ----
                      Ogre::Quaternion qx, qy, qz, kfQ;
  
+ 					// Milkshape translations are local to own orientation, not parent
+ 					kfPos = ogrebone->getOrientation() * kfPos;
+ 
                      ogrekey->setTranslate(kfPos);
                      qx.FromAngleAxis(Ogre::Radian(currRotKey->Rotation[0]), Ogre::Vector3::UNIT_X);

old_man_auz
Greenskin
Posts: 103
Joined: Tue Jun 15, 2004 5:10 am
Location: Australia
x 3

Post by old_man_auz »

thanks alot mate.. really appreciate it.

Ill try to apply the patch manually, but Im ignorant, so I mightn't be able to do it. If I can't have you updated the milkshape exporter on the website ?
old_man_auz
Greenskin
Posts: 103
Joined: Tue Jun 15, 2004 5:10 am
Location: Australia
x 3

Post by old_man_auz »

mate.. just tried it and its workin like a champion..

thanks again..
Post Reply