Game Development Community

dev|Pro Game Development Curriculum

Updated milkshape exporter

by Chris Robertson · 06/19/2004 (4:40 pm) · 257 comments

Last Updated: 12/11/08

Download the new milkshape exporter here.

You must be using at least Milkshape 1.8.3 to use this exporter.

Features:
- Triangle stripper
- Multiple collision meshes
- LOS collision meshes
- Full level of detail control
- Blended animations
- Mesh visibility animation
- Auto-details
- Auto-billboards
- Easy to use sequence/mesh/material property editor

Geometry
Any mesh whos name begins with 'Collision' will be interpreted as a collision mesh. These meshes should have a negative detail level. Any mesh whose name begins with 'LOScol' will be interpreted as a line of sight collision mesh.

LOD
The exporter supports any number of detail levels per mesh. Detail levels are stored as numbers at the end of the mesh name. If your meshes already have numbers at the end of their name, you will need to add a non numerical character at the end, or they will be interpreted as LOD. eg.

body0 will produce a mesh called 'body' with detail level 0
foot12d5 will produce a mesh called 'foot12d' with detail level 5

The original milkshape exporter output shapes with all visible meshes at detail level 0. If you are not making use of LOD, this is the best value to give to visible meshes. Meshes with a negative LOD will be exported but are not visible (eg collision meshes).

Sequences
Sequence special material naming convention has changed, as there is much more information to pack into the name now. Old sequence names are supported, but will be converted to the new convention when you apply changes to the model. All sequence information is now stored in the comment string of the special material.

A '*' at the start of the name indicates that this is a sequence special material

The best way to edit sequences is via the exporter dialog. Just add/select a sequence, then press the Edit button.

Configuration Files
The exporter supports configuration files using the same format as 3dsmax. The configuration file should use the same name as the exported dts shape. eg. use a configuration file called shape.cfg when exporting shape.dts. For most shapes you will not need to use a configuration file, the defaults provided by the exporter will be sufficient.

Documentation
Some alpha documentation is located within the zip file. It is based mostly on the existing 3dsmax/maya documentation and is still a work in progress. If you find any errors, or would like to add something, please feel free to contact me.

Known Issues
- Alpha sorting is supported (in that sorted meshes are passed through the sorting code), but I have not actually seen it working yet. When you view a sorted mesh in the show tool, some of the faces have been split (the poly count goes up), but the faces still appear sorted incorrectly.


I have tried hard to make this exporter fully functional, but it is quite possible that there are still problems with it. I advise you to SAVE your work before you export it, and because the exporter modifies the ms3d file to apply your changes, you should backup your files before using it. If you find something wrong, or even have a suggestion, please let me know.
#41
08/24/2004 (3:26 pm)
The best way to add new sequences is to use the exporter dialog box. When you hit Apply or Export, any changes are applied to the ms3d file.

The '*' at the front is only used by the exporter, so just enter the base name. Open the IFL example file and look at the sequence properties in the exporter dialog.

The documentation has details on how to generate an IFL sequence.
#42
08/24/2004 (5:45 pm)
=)...
#43
08/24/2004 (5:59 pm)
ok it works now..
but I found this doesnt work
"To use the IFL material in milkshape, a copy of texture1 is made and renamed to player_ifl. This new texture is used for uv mapping, and tells the exporter the name of the IFL file to use. It is only required during export, and is not actually used by the DTS shape."

I had it as tread_ifl.jpg and when i changed it to tread.ifl.jpg it worked..
doesnt like the underscore maybe?

i also added animation keys to the animation at the same time so may be either or.. but it compiled.. so thats a start.. so shoudl the animation play without script or do I need to add the script?
I saw on the box it did not animation but in show it did
weird

ok
enough for today.. :)
#45
08/30/2004 (4:36 pm)
Chris,

I know folks are keeping you plenty busy, but when you make a spanking upgrade like this, wel... you should expect it. :)

I was just kinda wonderin... did you look into that FPS issue? I'm using your exporter exlusively in the guide samples and have also seen that changing FPS does not modify the play rate when the shape is loaded and the animation is played in-game. For now, I'm just scaling the animation via MS3D tools, but that won't do as a final solution.

Thanks again for your work on this. [HOW]EdM|EGTGE
#46
08/30/2004 (11:48 pm)
@Ed: I've been a bit flat out to look at it lately - sorry to those who have been waiting. I think I've sorted the problem out in this new build.

Updates:
- fixed 'fps' animation setting
- added first cut of DSQ export

A note on DSQ exporting: Milkshape does some strange things with bones sometimes. If you open the Mr Box example file, then rotate any bone, you may notice that all the other bones rotate as well. This is a Milkshape issue, and has nothing to do with the exporter. As a result, DSQ export may not be 100% functional. I'm still looking into whether a better solution can be found.

Feel free to play around with it in the meantime though! ;)
#47
08/31/2004 (11:12 am)
Chris,

I'll try this out when I get home. Thanks a lot for following up so soon, it will really help me if that works now. BTW, I hope you haven't been sick, but if you have I hope you're feeling better. If you've been busy w/ other stuff, I totally understand.

Thanks (as always) for this great contribution,

Ed
#48
08/31/2004 (11:56 am)
@Ed: lol. In New Zealand 'flat out' means busy, not sick....but thanks for the sentiments. ;D
#49
08/31/2004 (5:39 pm)
Chris,

Excellent work again!! The FPS stuff works great for me. I haven't tried the DSQ's yet.

I hate to ask it....but: any word on ground transforms? Once we have that, there will be nothing left for us to complain about!!

MEL
#50
08/31/2004 (6:50 pm)
.....
#51
09/06/2004 (5:17 pm)
@Melvin: I have never made use of ground transforms, and don't really know too much about them. My understanding is that they are used to scale movement for eg running/walking animations. The ground transform is controlled by animating the bounds node, yes?

I have been playing around with the ability to add a custom bounds node, which should allow ground transforms to be exported.

If you know anything more about them I'd be interested to hear it. I'm trying to find time for one last update before I release the source code publically.
#52
09/06/2004 (5:44 pm)
@Chris: Sorry, I wish I could help you more. What I know about ground transforms is what I've read from the forums, and I have seen several of your questions bouncing around. From the description of what ground transforms do and how the engine uses them, they would be extremely useful, as all you do is specify the velocity of the shape and the animation is scaled (using the ground transform) to the proper fps to match the speed. It is also used to chose what animation to display based off of velocity. I wish I knew more than "it sure would be cool" in order to help you.

MEL
#53
09/14/2004 (8:46 pm)
I downloaded the newest version so I could export a vehicle with blended suspension animation. However, it crashes every time I try to export it. It does not crash when I export with the other "stock" exporter and there doesn't appear to be anything wrong with my model. What details should I supply to help throubleshoot?

The .dump file contains:

First pass: enumerate scene...

Processing Node susp_rr0 with parent ROOT
Adding skin object from skin "susp_rr0" to bone "hub3" (0).
Adding skin object from skin "susp_rr0" to bone "arm3" (1).

So far I have tried the following to keep it from crashing:
1) Disable exporting of animation
2) Delete the above mentioned node (next object in list takes its place)
3) Deleted all the suspension geometry and bones - it doesn't crash, but my car has no wheels or suspension

Thanks
#54
09/14/2004 (9:07 pm)
Hmmm. I found the cause of the problem, but I don't understand why it would be a problem.

If I unassign all verticies from all the suspension bones, it won't crash.

I started progressivley adding the assignments back and checking for crashing and here is what I found:

If I assign the verticies at the end of a cylinder to a node and I don't assign the verticies at the other end it will crash. If I assign all the verticies in the cylinder to the node it works fine.

Go figure!?
#55
09/15/2004 (12:34 pm)
@James: The easiest way to get a problem like this resolved is to send me the ms3d model, and a description of how to reproduce the problem.
#56
09/16/2004 (7:12 pm)
James,

I had an odd problem once that might be related. If you're willing (obviously this will take a bit of time), try this:

1. Create a node named root and and assign all vertices to it.
2. Create the remainder of your nodes as needed and assign vertices, again as needed.
3. Animate
4. Export.

I hope this helps and doesn't waste your time.

[HOW]EdM|EGTGE
#57
09/16/2004 (10:00 pm)
@Chris,

Hello again. I just noticed that IFL animations have stopped working in the last release. I'll have to dig up an older version for now, but just thought you might want to know.

[HOW]EdM|EGTGE

FYI - They do work in the July 21 version of this exporter.
#58
09/20/2004 (3:01 am)
I found last night that I can't use environment mapping... Works fine with it turned
off... Crashes TGE as soon as I set the slider (Left).... Back to standard exporter for now i guess... :( Thought i'd tell ya...

Feature Request: Multiple Materials (Textures) support... So a person can model a
vehicle with semi-transparent (translucend) windows. I'm not sure if it *should*
support this... but it crashes when loading TGE. Can anyone give me input on that?

And lastly... Is going to become part of Head? Or should anyone who needs extra
functionality start again from scratch with the Source provided? eg. implimenting
infinite camera nodes (not just eye/cam)

Regards
Burning
#59
09/20/2004 (11:15 pm)
Edit: Nevermind...
#60
09/21/2004 (1:55 pm)
@Burning: I will look into the environment mapping problem - I have certainly had it working in the past.

You can already use multiple textures (although milkshape only supports a single texture per mesh) in a shape.

The source code will eventually be added to HEAD, I wanted to get most of the functionality in first though. You can already add as many camera nodes as you wish, and call them whatever you like.