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.
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.
About the author
#62
- Added support for custom bounding box
- Fixed broken IFL support (my bad)
- Fixed problem with unattached vertices being attached to the wrong bone
- Various small code fixes
- Updated documentation
@Burning: I couldn't find anything wrong with environment mapping. If this new build does not solve the problem, you may need to send me the milkshape file that is causing the crash. You shouldn't have to touch the slider for environment mapping - use the export dialog.
@Alex: Thanks for that - it looks fine to me.
@Melvin: I haven't had time to try it out, but you could experiment with ground transforms by creating and animating the bounds mesh.
@James: The bug I found related to unattached vertices could be the cause of your problem - try the new build and let me know how you get on.
09/22/2004 (10:05 pm)
Updates:- Added support for custom bounding box
- Fixed broken IFL support (my bad)
- Fixed problem with unattached vertices being attached to the wrong bone
- Various small code fixes
- Updated documentation
@Burning: I couldn't find anything wrong with environment mapping. If this new build does not solve the problem, you may need to send me the milkshape file that is causing the crash. You shouldn't have to touch the slider for environment mapping - use the export dialog.
@Alex: Thanks for that - it looks fine to me.
@Melvin: I haven't had time to try it out, but you could experiment with ground transforms by creating and animating the bounds mesh.
@James: The bug I found related to unattached vertices could be the cause of your problem - try the new build and let me know how you get on.
#63
09/22/2004 (11:51 pm)
=)...
#64
09/27/2004 (11:49 pm)
Thanx Chris... Dunno why i didn't turn on my "Notify when new comments are posted"... I'll go have a look 2night... Keep up the good work!
#65
10/01/2004 (8:55 am)
I noticed another problem. It wouldn't let me use multiple Collision meshes. It exports and runs in the old DTS exporter. The version I am useing is old though. I will try updating it as soon as I connect my computer to the internet.
#66
I have been messing with the "bounds" mesh trying to get ground transforms to work. Now, my understanding isn't 100% on how its "suppose" to work, so this is both a question and a statement.
I created a mesh (simply a box) and named it "bounds" and attached it to my bip1 joint. So, in my milkshape the box animates with the model. But when I export it, in game, the model is rotated so that he is laying on his right shoulder and walking (sliding) along his path on his side. I tried rotating my bounds box inside of milkshape but with no effect. So I "believe" there is a problem.
To further my knowledge: using the "bounds" mesh causes TGE to calculate a ground transform. But does TGE also use this "bounds" mesh as a custom bounding box? And how does the bounding box for a player differ from a collision mesh? Custom collision meshes do not seem to do anything for the model, it all seems to be based on the bounding box when determining where the model intersects the ground and for determining if the model was hit by a projectile, etc. I'm just a bit confused here....
thanks
MEL
10/08/2004 (3:27 am)
Chris and others:I have been messing with the "bounds" mesh trying to get ground transforms to work. Now, my understanding isn't 100% on how its "suppose" to work, so this is both a question and a statement.
I created a mesh (simply a box) and named it "bounds" and attached it to my bip1 joint. So, in my milkshape the box animates with the model. But when I export it, in game, the model is rotated so that he is laying on his right shoulder and walking (sliding) along his path on his side. I tried rotating my bounds box inside of milkshape but with no effect. So I "believe" there is a problem.
To further my knowledge: using the "bounds" mesh causes TGE to calculate a ground transform. But does TGE also use this "bounds" mesh as a custom bounding box? And how does the bounding box for a player differ from a collision mesh? Custom collision meshes do not seem to do anything for the model, it all seems to be based on the bounding box when determining where the model intersects the ground and for determining if the model was hit by a projectile, etc. I'm just a bit confused here....
thanks
MEL
#67
10/11/2004 (2:55 pm)
posted to forums...
#68
10/12/2004 (4:29 pm)
It is not exporting one of my animations... the only one on this model. PlayThread is having no effect.
#69
eg.
- does the dump file show that an animation was exported?
- does the animation play in the show tool?
10/12/2004 (4:34 pm)
@Mike: My psychic powers are somewhat depleted - you will have to be much more specific in describing the problem.eg.
- does the dump file show that an animation was exported?
- does the animation play in the show tool?
#70
10/26/2004 (5:12 pm)
Edit: Bug has been dealt with =)
#71
The exporter is working great, but I am having difficulty figuring out what I have to do to get a run animation to be scaled based on speed once inside the game. It always plays at the set fps.
Is the solution in the model exporting or something in Torque? I am exporting as a dsq, but not as a blend for the run (difficulty keeping mountpoint orientations correct in the blend).
Thanks.
11/05/2004 (8:40 pm)
Chris,The exporter is working great, but I am having difficulty figuring out what I have to do to get a run animation to be scaled based on speed once inside the game. It always plays at the set fps.
Is the solution in the model exporting or something in Torque? I am exporting as a dsq, but not as a blend for the run (difficulty keeping mountpoint orientations correct in the blend).
Thanks.
#72
11/06/2004 (7:05 am)
Hey there, I love the DTS exporter. One quick question. I'm making a pipe for an undersea type game and using simple blocks to make collision meshes for the pipe itself (interiors haven't been working correctly for me to make the pipe, but that's a different story). So I have a pipe with 12 'sides' as it were so 12 blocks to use as collisions. 9 of them seem to work fine, but the last one, which is exactly duplicated from one of the others (no material assigned) seems to not allow collisions. My player and weapons can go right through. The other 9 work just fine. Is there a limit to the actual number of collision meshes the dts exporter can export? I have them named "Collision1_-1" through "Collision12_-12" (no quotes of course). Any help would be greatly appreciated.
#73
11/06/2004 (8:53 am)
Jonathan - TGE has maxCollisionMeshes set to 9. You COULD change it...
#74
11/06/2004 (8:59 am)
Where would I change that at? Thanks for the info!
#75
@Jonathan: You will need the SDK to change the value. Just do a text search.
11/06/2004 (11:24 am)
@Derk: I believe you need to use a ground transform for that. I don't know if anyone has had success with ground transforms using the new exporter yet.@Jonathan: You will need the SDK to change the value. Just do a text search.
#76
It took me a while to figure out the ground transforms. I have tried them out and had the same problems as MEL, i.e rotation of the entire model. Here is some data from the dump files.
With bounding box:
...
Add default node states...
Adding node rotation at time 0.000000 for node "base".
rotation: x=0.00000, y=0.00000, z=0.00000, w=1.00000
---------------------------------
Adding node translation at time 0.000000 for node "base".
translation: x=0.00000, y=0.00000, z=0.00000
---------------------------------
...
Without the bounding box:
...
Add default node states...
Adding node rotation at time 0.000000 for node "base".
rotation: x=0.70711, y=0.00000, z=0.00000, w=0.70711
---------------------------------
Adding node translation at time 0.000000 for node "base".
translation: x=-0.00087, y=0.00000, z=0.00143
---------------------------------
...
With and without the bounding box:
...
Adding 13 ground transform frames at 0.100000 sec per frame intervals.
Ground transform frame:
trans=(0.000000,-0.000000,-0.000000)
rot=(-0.000000,0.000000,0.000000,1.000000)
...
all 13 frames are the same, i.e. nothing.
I don't know how you have coded it, but it appears that you need to identify the model named "bounds" and find the node it is attached to. Then remove the horizontal transformations from the node (but leave the vertical transformations and all rotations), and move them to the ground transforms.
The model "bounds" can be ignored (which it currently appears to be) because Torque gets the bounding box dimensions from the player datablock not from the dts file.
I am very excied about getting these to work because am using a throttle system and need to scale the animations.
Thanks.
11/10/2004 (5:17 pm)
Chris,It took me a while to figure out the ground transforms. I have tried them out and had the same problems as MEL, i.e rotation of the entire model. Here is some data from the dump files.
With bounding box:
...
Add default node states...
Adding node rotation at time 0.000000 for node "base".
rotation: x=0.00000, y=0.00000, z=0.00000, w=1.00000
---------------------------------
Adding node translation at time 0.000000 for node "base".
translation: x=0.00000, y=0.00000, z=0.00000
---------------------------------
...
Without the bounding box:
...
Add default node states...
Adding node rotation at time 0.000000 for node "base".
rotation: x=0.70711, y=0.00000, z=0.00000, w=0.70711
---------------------------------
Adding node translation at time 0.000000 for node "base".
translation: x=-0.00087, y=0.00000, z=0.00143
---------------------------------
...
With and without the bounding box:
...
Adding 13 ground transform frames at 0.100000 sec per frame intervals.
Ground transform frame:
trans=(0.000000,-0.000000,-0.000000)
rot=(-0.000000,0.000000,0.000000,1.000000)
...
all 13 frames are the same, i.e. nothing.
I don't know how you have coded it, but it appears that you need to identify the model named "bounds" and find the node it is attached to. Then remove the horizontal transformations from the node (but leave the vertical transformations and all rotations), and move them to the ground transforms.
The model "bounds" can be ignored (which it currently appears to be) because Torque gets the bounding box dimensions from the player datablock not from the dts file.
I am very excied about getting these to work because am using a throttle system and need to scale the animations.
Thanks.
#77
11/14/2004 (6:06 am)
Do you think adding a Node named Bounds and linking it to the bounds object and animating that too might produce necessary ground transforms???
#78
This is a slight update for the exporter...the main fix is in the normals calculations on export. Currently it doesn't support smoothing groups but it will respect the rotation of the Bounds node/box which was a bug in the current version.
11/15/2004 (1:38 pm)
www.bravetree.com/GarageGames/ms2dtsExporterPlus.zipThis is a slight update for the exporter...the main fix is in the normals calculations on export. Currently it doesn't support smoothing groups but it will respect the rotation of the Bounds node/box which was a bug in the current version.
#79
Nope. Naming a node bounds real messes up the exporter and causes it to error out.
Thanks.
11/15/2004 (1:42 pm)
Rex,Nope. Naming a node bounds real messes up the exporter and causes it to error out.
Thanks.
#80
Thanks for this contribution. This exporter has really helped w/ the making of samples for EGTGE.
On that note, I've noticed the LOSCol-n (n == 9..16) does not seem to work. The docs that come with the exporter say this is untested.
I'm not sure how busy you are, but it would be great if you could fix this? Thanks in advance if you have the time. Regardless, this does fill a gap.
Thanks,
Ed M.
PS - The collision (normal and LOS) mesh names I've got are:
LOSCol-9 and collision-1. The dump indicates:
...
Adding detail named "LOS-9" of size -9 to subtree "__mainTree".
...
Adding detail named "LOS-9" of size -9 to subtree "__mainTree".
Adding detail named "Collision-1" of size -1 to subtree "__mainTree".
...
Adding object named "LOSCol".
Adding mesh of size -1 to object "LOSCol".
Adding node "Col-1" with parent "__meshes" to subtree rooted on node "__mainTree".
Attaching object to node.
Adding object named "Col".
Adding mesh of size -1 to object "Col".
...
Shape Hierarchy:
Details:
detail1, Subtree 0, objectDetail 0, size 1
Collision-1, Subtree 0, objectDetail 1, size -1
LOS-9, Subtree 0, objectDetail 2, size -9
Subtrees:
Subtree 0
Box1 --> Object Box with following details: 1
LOSCol --> Object LOSCol with following details: -1
Col-1 --> Object Col with following details: -1
Root
I'm thinking the LOSCol naming convention is getting mixed up.
Note: I'm debugging using the Show Tool Pro
Thanks again,
Ed
01/15/2005 (4:35 pm)
Chris/Matt,Thanks for this contribution. This exporter has really helped w/ the making of samples for EGTGE.
On that note, I've noticed the LOSCol-n (n == 9..16) does not seem to work. The docs that come with the exporter say this is untested.
I'm not sure how busy you are, but it would be great if you could fix this? Thanks in advance if you have the time. Regardless, this does fill a gap.
Thanks,
Ed M.
PS - The collision (normal and LOS) mesh names I've got are:
LOSCol-9 and collision-1. The dump indicates:
...
Adding detail named "LOS-9" of size -9 to subtree "__mainTree".
...
Adding detail named "LOS-9" of size -9 to subtree "__mainTree".
Adding detail named "Collision-1" of size -1 to subtree "__mainTree".
...
Adding object named "LOSCol".
Adding mesh of size -1 to object "LOSCol".
Adding node "Col-1" with parent "__meshes" to subtree rooted on node "__mainTree".
Attaching object to node.
Adding object named "Col".
Adding mesh of size -1 to object "Col".
...
Shape Hierarchy:
Details:
detail1, Subtree 0, objectDetail 0, size 1
Collision-1, Subtree 0, objectDetail 1, size -1
LOS-9, Subtree 0, objectDetail 2, size -9
Subtrees:
Subtree 0
Box1 --> Object Box with following details: 1
LOSCol --> Object LOSCol with following details: -1
Col-1 --> Object Col with following details: -1
Root
I'm thinking the LOSCol naming convention is getting mixed up.
Note: I'm debugging using the Show Tool Pro
Thanks again,
Ed

Torque Owner Alex Swanson