Previous Blog Next Blog
Prev/Next Blog
by date

Blender DTS Exporter 0.95 Released

Blender DTS Exporter 0.95 Released
Name:Joseph Greenawalt
Date Posted:Aug 10, 2007
Rating:5.0 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Joseph Greenawalt

Blog post
A new 0.95 version of the Blender DTS Exporter for Torque has now been released.
The new version requires Blender 2.44 or higher.

You can download the new release at the exporter project page: projects.blender.org/frs/?group_id=95
(edit - link is currently down, see the first comment for a mirror link)

Be sure to check the Readme.html file included with the exporter if you are a new user, or if you run into problems.

Many thanks go out to everybody who helped out with this release. Contributions are listed below.


What's New for version 0.95


  • Blender 2.44 and Python 2.5 compatibility.

  • New GUI tab controls, rewrote GUI event handling code

  • New "Materials" panel, material system rewrite. Features include:

....................... Additive and subtractive texture options
....................... Self Illuminating texture options
....................... Control of texture wrapping
....................... Support for scaling of detail maps
....................... Improved support of Environment mapping and reflectivity
....................... Reflectance Maps (partially supported in TGE)
....................... TGE "Bump" Maps (not supported in TGE)
....................... Improved control of mipmaping
....................... Users can now UV map multiple textures onto a single mesh without assigning material indices
  • Fixed refresh of output path when selecting a new destination

  • Removed unused DTS version spinner from general panel

  • Added a log error message when no shape marker is found

  • Added a refresh button to the Armatures panel

  • Fixed a bug that would sometimes cause the DTS file stream not to close properly

  • Fixed a crash bug when exporting collision meshes with zero vertices

  • Fixed exporter crash when exceeding max per-mesh dts triangle count. Meshes that exceed the limit are now truncated and a message is written to the log. Maximum triangle count is around 10,900.

  • Reverted buggy optimizations to animation export code introduced in version 0.94 that were resulting in mangled export of bones in some cases, thanks go out to Scott Coursey for finding the problem.

  • Fixed a problem with autobillboard detail levels that prevented them from displaying when a collision or loscollision mesh is present, thanks go out to Pho for finding and helping to diagnose the problem

  • Fixed a bug in the ground transform export, thanks go out to Duncan Gray for his help in finding and diagnosing the problem

  • Added an option to the General tab to write the export log file to the .dts output folder instead of the folder containing the .blend file (on by default).

  • Added the ability to have multiple materials that use the same base texture. This is accomplished by adding ".IGNORE" to the end of the blender image name (ex: "myTex.IGNORE01", "myTex.png.IGNORE.001", etc.). Just prior to export, the exporter will strip off the "IGNORE" portion of the material name and anything after it. This allows for the export of multiple materials with the same (base texture) name, but different properties. When generating a TSE (TGEA) material script for a material containing "IGNORE", only the period delmited section starting with "IGNORE" is stripped from the script material name. For example, "myTex.IGNORE.001" would generate a TGEA material called "myTex.001" with a base texture of "myTex".

  • Numerous bugfixes. Thanks go out to Duncan Gray, Adam Wilson, and Pho. Additional thanks go out to James Urquhart for writing the exporter in the first place and for suggestions in the user interface thread. Thanks also go out to Todd "zaz" Koeckeritz and Scott Coursey for suggestions and discussion in the user interface thread. And to anyone else that I missed.

Recent Blog Posts
List:04/10/08 - Blender DTS Exporter 0.96 Released
09/11/07 - Blender Orange Guy Now available
08/10/07 - Blender DTS Exporter 0.95 Released
02/04/07 - Blender DTS Exporter 0.94 Released
12/26/06 - Blender DTS Exporter 0.93 Released
11/25/06 - Blender DTS Exporter version 0.92 released
02/15/06 - Blender Exporter User interface Overview, more to come.
05/21/05 - Plan for Joseph Greenawalt

Submit ResourceSubmit your own resources!

Joseph Greenawalt   (Aug 10, 2007 at 21:46 GMT)
It looks like the file's not available yet at the project site, so here's a mirror:
DTSExporter_095.zip

Simon Love   (Aug 10, 2007 at 22:39 GMT)
Awesome!

I was still working with Blender 2.43 due to the exporter incompatibility (there were workarounds, but 2.43 worked pretty well out-of-the-box).

@Joseph : It works fine, but I had to make sure that my texture names did not exceed 21 characters.

For instance, my test model used a texture called <b>spaceship01_Glider.png</b>. When opened in Blender 2.44, everything works fine, but once I fire up the DTS exporter, the name will be truncated to <b>spaceship01_Glider.pn</b>.

In TGB 1.5, the program simply crashes when trying to load the model.
In TGE 1.5.2, the model loads, but the console mentions that it is trying to find the .pn file, which obviously does not exist.

I understand it is kinda stupid to name textures like such, but the issue occured and I thought you might like to know!

Aside from that, thank you so much, it works super fine!

Joseph Greenawalt   (Aug 10, 2007 at 22:43 GMT)
Thanks for the info Simon, I'll try and find out where that 21 character limit is and remove it if possible.

Joseph Greenawalt   (Aug 10, 2007 at 22:56 GMT)
@Simon:

It looks like the 21 character limit is coming from Blender itself. I'm only able to type 21 characters when attempting to change the name of a texture in the UV image editor window, and only 20 when attempting to change a material name. You can regain up to 4 characters by removing the image file extension from the image name in Blender. In fact, the exporter is supposed to remove it for you, but since your extension has already been truncated to ".pn" it doesn't recognize it as an image extension and leaves it as-is.

Simon Love   (Aug 10, 2007 at 23:07 GMT)
Thank you for the fast response!!!

Jason Howard   (Aug 11, 2007 at 02:09 GMT)   Resource Rating: 5
thank you!!!

Duncan Gray   (Aug 11, 2007 at 02:37 GMT)
Nice work Joseph. I wont be testing it for some time but its good to know it exists.

Gustavo Munoz   (Aug 11, 2007 at 06:29 GMT)
Thanks!

Vashner   (Aug 11, 2007 at 07:13 GMT)   Resource Rating: 5
Wowers!!!!

Frank Carney   (Aug 12, 2007 at 02:53 GMT)
I love you Joseph, in a totally non-gay way!!!

Joseph Greenawalt   (Aug 12, 2007 at 03:00 GMT)
LOL Frank :-)

metalliandy   (Aug 15, 2007 at 18:20 GMT)
Nice work :)

Earl Carey   (Aug 19, 2007 at 16:33 GMT)   Resource Rating: 5
great work guys. Thanks for doing this it makes my life alot easier.

Washington St. Uni. CS (#0002)   (Aug 20, 2007 at 20:29 GMT)
Not a terribly big woop but 'util/Install Script.sh' uses Windows newlines which makes Linux very unhappy:
atagar@vili:~/Desktop/DTSExporter_095.zip_FILES/util$ ./Install\ Scripts.sh
bash: ./Install Scripts.sh: /bin/bash^M: bad interpreter: No such file or directory

I'm guessing this was developed via Cygwin? I corrected this with the Perl script at 'http://www.linuxforums.org/forum/redhat-fedora-linux-help/65469-bad-interpreter-no-such-file-directory.html'. Also, a little note in the installation instructions that this needs to be run from the base directory rather than util might be nice- the output simply complains that it didn't work and I needed to look at the script to figure this out.

Simple installation otherwise. Thanks!

Joseph Greenawalt   (Aug 20, 2007 at 20:48 GMT)
@ Wash St. Uni #2:
Thanks for the info. The installers were supposed to be placed in the base directory within the zip, but I forgot to move them prior to packaging. I thought the newline issue had been fixed quite a while ago, but it may have recurred in the migration from CVS to SVN. I'll double check it and update the zip file.

Simon123   (Aug 26, 2007 at 11:14 GMT)
Where can i put this file?

Washington St. Uni. CS (#0002)   (Aug 29, 2007 at 17:56 GMT)
I just put up a quick start guide for the exporter. Unfortunately the readme is less than helpful for those just learning Blender, and I didn't stumble upon the video tutorials until after I'd spent days of trial and error figuring it out. Hopefully someone will find it helpful...
http://www.eecs.wsu.edu/~djohnson/dtsExporterGuide/

Joseph Greenawalt   (Aug 29, 2007 at 19:59 GMT)
Nice work :-) I thought I'd take a few minutes to address some of the points you bring up in the tutorial.

Quote:

The readme says 'X' is the 'detail level size' which I won't even pretend to understand, but it looks like a power of two (usually 32) is a good bet.

The detail level size is (supposedly) the display height in pixels above which the detail level will draw. For example, if your shape is 32 pixels tall on the screen (or taller), the Detail32 detail level will be drawn. If it goes above 64 pixels tall, and a Detail64 detail level is present, the Detail level will switch to Detail64.

Quote:

2 Create a bounding box called "Collision".

* Hit the space bar and select Add > Mesh > Cube.
* Move and scale it to fit around your figure. It might help to make it appear as a wire frame by hitting F5 and select "Wire" in the Draw section.
* Press F9 and change the name to "Collision".

3 Make a parent for the detail and collision objects called "Shape".

* Hit the space bar and select Add > Empty.
* Press F9 and change the name to "Shape".
* Make the this the parent of your shape and collision objects.


I think there is a mistake here. You should create an empty called "Collision-x" and parent your collision meshes to it. If parenting a mesh called "Collision" to the shape marker works, well, more power to you, but it's probably a bit of a fluke that it does anything at all :-)

Quote:

Curious what the buttons do? So am I but I have yet to find an explanation and there isn't any "set to defaults" so your best bet is look but don't touch unless something goes wrong.

There's an exporter user interface overview posted on TDN. It's a bit out of date, but it should still cover most of the available options: tdn.garagegames.com/wiki/DTS/Blender/Exporter_User_Interface_Overview
If you want to reset the exporter setting back to the defaults, open up a blender text editor window and find the text buffer called "TORQUEEXPORTER_CONF" or "TORQUEEXPORTER_SCONF" and delete it by clicking the 'x' next to the text buffer name. Next time you run the exporter, the preferences will be regenerated.

Quote:

Is Torque showing a gray mass where your masterpiece should be? After a couple days of trial and error I suspect most Blender materials aren't supported. However, image textures work given some special conditions are met. Here's the things the exporter seems to require:

1. The name assigned to the material needs to match the image (excluding the extension). For instance if applying "sunny.png" then hit F5 for the materials, and change the name under "Links and Pipeline" to "MA:sunny".


Most of the fancy stuff that you can do in blender with materials isn't supported, as you've found out. Torque's material system and Blender's material system are not very close to each other in terms of functionality. 0.95 allows you to not even bother with Blender's material system if you don't want to. Basically all that's needed is to open up your texture files in the UV/Image editor, UV map them to your meshes, and set up any flags that you'd like to use under the exporter materials panel. No need to rename materials. The exporter does initially read it's material flags from the blender materials, using a somewhat complicated and confusing system that is outlined in the exporter readme under "old material setup". It will also fall back on using the Blender materials if no UV mapped textures are found. The new system is designed to take the guesswork away and let you have direct control over dts flags and material settings via the Materials panel of the exporter, while still providing backwards compatibility with old shapes by using the fallbacks.
Edited on Aug 29, 2007 20:05 GMT

Joseph Greenawalt   (Aug 29, 2007 at 20:03 GMT)
I'll also add that the detail size numbers don't have to be a power of 2, they can be pretty much any number you want (within reason).

Washington St. Uni. CS (#0002)   (Aug 29, 2007 at 22:02 GMT)
Thanks for the correction, I've updated the guide. Are you sure the name should be "Collision-x" and if so, is this x the detail level as well? Both the readme and sample scene simply use "Collision". As for resetting the defaults, it seems to require restarting Blender after deleting the config file- otherwise opening the exporter dialog again recreates TorqueExporter_SCONF without reverting the settings.

Joseph Greenawalt   (Aug 29, 2007 at 22:33 GMT)
Quote:

Are you sure the name should be "Collision-x" and if so, is this x the detail level as well? Both the readme and sample scene simply use "Collision"


Yeah, just using Collision by itself is fine, but if you want you can optionally have more than one collision marker (empty) with a -x tacked onto the end. the "x" is just a number as far as the collision meshes go, no relation to the detail level numbers. It should probably be between 1 and 9, although I believe that restriction has been removed from the engine. The important thing is that there is an empty named "Collision*" with mesh(es) parented to it. There shouldn't ever be meshes parented directly to the shape marker (it is allowed, but may result in problems down the line).

Quote:

As for resetting the defaults, it seems to require restarting Blender after deleting the config file- otherwise opening the exporter dialog again recreates TorqueExporter_SCONF without reverting the settings.

Alternately, you can save the file and then reload it without closing blender. This is necessary because of the way Blender's internal garbage collection works (deleted objects still hang around in memory until a save and reload or a restart of blender).

John Purchase   (Oct 01, 2007 at 17:27 GMT)
I'm getting crashes in DTS exporter v0.95.

For lack of a better place, I'm putting a bug report here. If there is a better place to log this sort of thing, let me know.

I'm running on a Mac with Python v2.5 and Blender v2.45. It works great for static models but as soon as I try to export sequences I run into problems. Here's the output from the console:

/Applications/Blender/Blender.app/Contents/MacOS/./.blender/scripts/DTSPython/Dts_Shape.py:272: FutureWarning: x<<y losing bits or changing sign will return a long in Python 2.4 and up
StateOn = 1 << 31
Traceback (most recent call last):
File "/Applications/Blender/Blender.app/Contents/MacOS/.blender/scripts/Common_Gui.py", line 1166, in button_event
c.onAction(evt, curMousePos, -1)
File "/Applications/Blender/Blender.app/Contents/MacOS/.blender/scripts/Common_Gui.py", line 513, in onAction
control.onAction(evt, newpos, value)
File "/Applications/Blender/Blender.app/Contents/MacOS/.blender/scripts/Common_Gui.py", line 152, in onAction
if self.callback: self.callback(self)
File "<string>", line 1329, in guiBaseCallback
File "<string>", line 829, in export
File "<string>", line 489, in process
File "<string>", line 754, in process
AttributeError: 'module' object has no attribute 'format_exc'

I haven't tried debugging the scripts yet - I suppose I can give that a go. But before I'm up to my elbows in python, has anyone else had the same problem?

Joseph Greenawalt   (Oct 01, 2007 at 17:48 GMT)
I've seen that error before, but only when the exporter attempted to write an exception traceback to the log file and a full version of Python was not present. I added some code at one point to avoid the problem when there wasn't a full version of Python, but it looks like perhaps 'format_exc' has gone away completely in Python 2.5? I'll take a look at it when I get home from work.

Joseph Greenawalt   (Oct 01, 2007 at 22:40 GMT)
@John:
Are you sure Blender is using Python 2.5? The warning:

FutureWarning: x<<y losing bits or changing sign will return a long in Python 2.4 and up

Should only occur if you're using Python 2.3. If you run blender from a console window, it should print the python version that it's using to the console when you load it. My guess is that since the Mac version of Blender is compiled to use Python 2.3 it's ignoring your Python 2.5 install and using the system default (2.3) install instead. In that case, the 'format_exc' AttributeError makes sense because format_exc does not exist in Python 2.3 AFAIK.

In any case, the original exception that's being thrown is probably on line 489 of Dts_Blender.py. I'm unable to reproduce it here since a recent build of Blender for windows that uses Python 2.3 is not readily available. If you can figure out what's causing the problem and/or a solution, let me know and I'll make sure it's fixed in the next point release. I think this is going to become an increasingly common problem as the Mac version of Blender stays on Python 2.3 while the Linux and Windows versions continue to move on to the newest versions of Python :-(

It would be really nice if someone would make available a windows version of Blender 2.45 that's compiled against Python 2.3, but I've been unable to locate one or compile my own thus far.
Edited on Oct 01, 2007 22:41 GMT

John Purchase   (Oct 02, 2007 at 12:27 GMT)
Those are helpful clues.

I've installed python 2.5...

Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin

...but I don't know for sure that Blender used it.

Thanks for pointing me in a likely direction. I'll let you know when I get it figured out.

Mirai Warren   (Oct 14, 2007 at 10:29 GMT)
Maybe this is a dumb question, but what should I do when I get this error?:
Traceback (most recent call last):
File "<string>", line 34, in <module>
ImportError: No module named DTSPython

Thank you.

Joseph Greenawalt   (Oct 14, 2007 at 16:23 GMT)
@Mirai:
Did you copy the DtsPython folder and it's contents into your scripts folder along with the other files?

Mirai Warren   (Oct 17, 2007 at 12:51 GMT)
I did.

Joseph Greenawalt   (Oct 17, 2007 at 12:53 GMT)
That error means that it's not there, or that the files that it's supposed to contain are not there. Other than that, I don't know what to tell you. Sorry.

John Purchase   (Oct 24, 2007 at 22:32 GMT)
@Joseph

I think I managed to get things sorted out. There is a Mac blender build that uses 2.5 Python, available on the blender site, that is working well for me. The frustrating bit was that I spent a lot of time trying to build blender myself before I found the link on the blender site - good experience, so not all bad.

Anyway, the exporter seems to work fine in this build. Not conclusive, but I'd guess you were bang-on with your guess that blender uses the version of python it's built with, not what's installed.

Thanks for your help.

Mark Herb   (Dec 30, 2007 at 22:59 GMT)
Where do I get the latest version of python? Could you give me a link?
<<<<<<<<<<<<>>>>>>>>>>>>>><<<<<<<<<<<<<<>>>>>>>>>>>
Edited on Dec 30, 2007 23:02 GMT

Joseph Greenawalt   (Dec 30, 2007 at 23:03 GMT)
www.python.org/download/

Mark Herb   (Jan 01, 2008 at 20:00 GMT)
Thanks.

Mark Herb   (Jan 04, 2008 at 16:23 GMT)
How do you get Blender to use python 2.5.1 on Mac OsX? I am using blender 2.45.

John Purchase   (Jan 04, 2008 at 23:34 GMT)
@Mark

Blender has to be compiled from source to use python 2.5. You could try to do this yourself - I tried but wasn't successful. Fortunately, someone has already done it for you.

Look on the Blender download page (http://www.blender.org/download/get-blender/) for "Custom Python 2.5 installations" and pick the one for your processor (ppc/intel).

Mark Herb   (Jan 05, 2008 at 01:30 GMT)
Thank you VERY much!
ps. I found the place, but it's down. I'll try later though.

John Klima   (Jan 06, 2008 at 21:54 GMT)
hi joseph!

great work with the new exporter! i love the material stuff.

for the first time, i have had to try to export animated collision meshes, and i'm not having a good time with it. the post for version .94 (i think) says to make a location constraint on the collision mesh and assign the bone to the constraint. but what if the bone is a rotation?

for example, i simply want to make an animated door geometry that allows the player to pass through when it swings open. i have to believe this is possible??

thanks!

Joseph Greenawalt   (Jan 06, 2008 at 22:03 GMT)
@John:

The exporter checks the collision mesh(es) to see if any of them have any type of constraint with a bone as a target. If it finds a constraint, the collision mesh will end up being rigidly attached to the bone upon export; so it will follow location, rotation, and scale of the constraint target bone (node) regardless of the constraint type. If you want you can add both a copy location and a copy rotation constraint to a collision mesh with the same bone as the target for both. That way you can preview both the location and rotation of the collision mesh inside of Blender.

John Klima   (Jan 06, 2008 at 22:13 GMT)
wow that was like crazy fast reply!

that's what i was thinking, but if i add both rotation and position, my collision mesh (in blender) skews rather than rotates.

do i need to do anything special to the origin of the collision mesh for the rotation to work right, or do the same thing as if it was animated via vert groups?

Joseph Greenawalt   (Jan 06, 2008 at 22:24 GMT)
That's odd. I'm not seeing any skewing here within Blender when rotating the target bone around in pose mode. Does your mesh object have an unapplied non-uniform scale? You might try applying all transforms on the mesh object to see if the skewing goes away.

John Klima   (Jan 07, 2008 at 00:38 GMT)
duh that is exactly what it was, i made a cube, scaled it so it was the proportions of, wild guess, a door. as long as i scale the MESH and not the OBJECT, all works out. this is a bit odd as the exporter must apply the object transforms to the mesh, right?

thanks again!

Joseph Greenawalt   (Jan 07, 2008 at 01:20 GMT)
Yeah, the exporter applies all object level transforms (or at least it tries to :-). The skewing you were seeing in Blender definitely shouldn't show up in the exported animation. I'm not entirely sure why non-uniform scale and copy rotation constraints together produce skewing in Blender, but If I had to guess I'd say that it's probably some quirk in the order of the matrix calculations for the display data. Usually you don't have to worry about whether your object level transforms are applied or not.

John Klima   (Jan 18, 2008 at 16:01 GMT)
sorry to bug you again, but now i have a very simple animation that for some reason, will only export one frame. it has 60 framelength and several keys on nodes. it loads into showtool with the single frame, which happens to be the last frame of the animation

at first the anim didnt export at all, so i deleted it and re-created. now just the one frame. starting completely fresh with a dumb box and a similar simple animation, i have no troubles.

any ideas?

best,
j

Joseph Greenawalt   (Jan 18, 2008 at 16:10 GMT)
Have you checked the "Sample Frames" setting on the sequences panel of the exporter to see if it's accidentally been set to 1 frame? If not, can you email me a copy of the file?

John Klima   (Jan 18, 2008 at 16:17 GMT)
i thought that was it but it only allows for one frame when i choose cyclic, i cant set it to anything else, so i thought that was normal. i'll send file to your pub addr

John Klima   (Jan 18, 2008 at 16:25 GMT)
sheesh! if i uncheck cyclic, save, reload the file, i can then set samples and recheck cyclic. funky!
thanks for pointing me in the right direction

Joseph Greenawalt   (Jan 18, 2008 at 16:29 GMT)
OK, it's letting me set it up to 100 frames here. The options on the right side of the sequences panel are only settable if a specific sequence is selected in the sequence list. If you try to change the sample frames setting without first clicking on a specific sequence in the list, it won't let you change the value. Try clicking on the name of the "Open" animation in the sequence list, then drag the sample frames number picker control all the way to the right. It should let you change the value as long as the sequence is selected. I've thought about hiding those controls when no sequence is selected in the list, but I'm not sure if that would be more confusing or less :-)

John Klima   (Jan 20, 2008 at 13:01 GMT)
doh, thanks again. i never realized that.

You must be a member and be logged in to either append comments or rate this resource.