Translating static dts meshes
by Thomas -elfprince13- Dickerson · 10/18/2009 (4:12 am) · 5 comments
I'm gaining a new respect for the evil genius of GarageGames employees and the many evolutions that TGE has gone through as I've been digging through the code used to load a .dts file into a useable TSShape.
The project I'm currently developing for began as a script-only mod for another Torque based game, and the majority of the original dev-team has moved on to other things. This means we've been left with a large number of art resources for which we have static .dts meshes but no source model. Some of these were not cleanly exported the first time around and have incorrect collision meshes or other little oddities, and a couple have to be offsetted by the same constant in every datablock that uses them. Until now this has only been a minor annoyance, however I recently (thanks to some help from Tom Bampton) began moving our character customization interface from a rough 2d decal based system to a full 3d preview of the character, and I noticed that at least 2 of the dts's being mounted on the character were from the set that needed a position offset. In game this is fine, but the new preview control didn't have any built-in way of doing this, and I figured as long as I was going to be doing some non-trivial coding I should write myself a more general solution that would allow me to open the model in milkshape, move offset it once, and re-export. Plus I'll be able to fix the couple bothersome models with incorrect collision meshes.
I realize that a fair number of Torque artists are (or were) strongly opposed to the release of a tool that would allow decompiling .dts files back into an editable format, and so my current plan is to release my program in a form that will only handle un-animated meshes. It'd be nice to get some discussion going though to see what people are feeling.
also, irony++: Python is more suited for this task than Java, because unlike Java, Python's ctypes module supports signed and unsigned values. Java does not. Some of you may wonder why I'm not just doing this in C or C++, and the answer is because I'm developing for multi-platform situations, Python is easier to debug, and it's not a speed critical situation.
The project I'm currently developing for began as a script-only mod for another Torque based game, and the majority of the original dev-team has moved on to other things. This means we've been left with a large number of art resources for which we have static .dts meshes but no source model. Some of these were not cleanly exported the first time around and have incorrect collision meshes or other little oddities, and a couple have to be offsetted by the same constant in every datablock that uses them. Until now this has only been a minor annoyance, however I recently (thanks to some help from Tom Bampton) began moving our character customization interface from a rough 2d decal based system to a full 3d preview of the character, and I noticed that at least 2 of the dts's being mounted on the character were from the set that needed a position offset. In game this is fine, but the new preview control didn't have any built-in way of doing this, and I figured as long as I was going to be doing some non-trivial coding I should write myself a more general solution that would allow me to open the model in milkshape, move offset it once, and re-export. Plus I'll be able to fix the couple bothersome models with incorrect collision meshes.
I realize that a fair number of Torque artists are (or were) strongly opposed to the release of a tool that would allow decompiling .dts files back into an editable format, and so my current plan is to release my program in a form that will only handle un-animated meshes. It'd be nice to get some discussion going though to see what people are feeling.
also, irony++: Python is more suited for this task than Java, because unlike Java, Python's ctypes module supports signed and unsigned values. Java does not. Some of you may wonder why I'm not just doing this in C or C++, and the answer is because I'm developing for multi-platform situations, Python is easier to debug, and it's not a speed critical situation.
About the author
C.S. PhD student at Brown University. Project lead for FreeBuild. Administrator, Cemetech tech community. Webmaster for the Village2Village Projects and the Vermont Sustainable Heating Initiative.
#2
10/18/2009 (6:18 am)
Do a Google search for Ultimate Unwrap 3D Pro. It can import/export/convert .dts files. It's only 60 bucks.
#3
10/18/2009 (11:01 am)
Are you aware of Shaper3D by Andrew Luddy? It's only $35 and created exclusively for importing/exporting/converting .dts files, and it handles .dsq's also.
#4
Kerry and Michael: I'm aware of Shaper3D, and have played with it a bit. I hadn't heard of Ultimate Unwrap Pro, but as a college student/hobbyist I just don't have the funds to justify shelling out just for a program to import/export one format. I already have an old free version of lithunwrap, which suits my unwrapping purposes just fine, and I already have milkshape which suits my modeling purposes just fine, so in both cases the only the thing the new program gives me is the ability to import and export dts. I'd be a little more inclined to purchase Shaper if Andrew hadn't abandoned it and actually released the Mac version. Finally, it's always more rewarding to write code yourself to understand how things work, and I'd really like something that's multiplatform.
10/18/2009 (11:42 am)
Josh, thanks, that could be really interesting to look through, although I seem to be making pretty good progress just referencing the C++ code to see how the engine uses it.Kerry and Michael: I'm aware of Shaper3D, and have played with it a bit. I hadn't heard of Ultimate Unwrap Pro, but as a college student/hobbyist I just don't have the funds to justify shelling out just for a program to import/export one format. I already have an old free version of lithunwrap, which suits my unwrapping purposes just fine, and I already have milkshape which suits my modeling purposes just fine, so in both cases the only the thing the new program gives me is the ability to import and export dts. I'd be a little more inclined to purchase Shaper if Andrew hadn't abandoned it and actually released the Mac version. Finally, it's always more rewarding to write code yourself to understand how things work, and I'd really like something that's multiplatform.
#5
10/18/2009 (11:57 am)
*nods* Unfortunately Shaper is no longer maintained. 
Associate Josh Engebretson
You should look at the DTSPython folder in the Blender plugin sources... loads of good stuff for working with the format in Python there:
http://projects.blender.org/frs/?group_id=95