Game Development Community

Future of the blender exporter

by James Urquhart · in Artist Corner · 11/13/2004 (12:32 am) · 63 replies

There are many issues that i wish to address with a future release of the blender exporter :

The documentation
Although i sent off documentation to GG for inclusion in the docs on-site, they have failed to be intergrated (after a few months no doubt). I am considering including this documentation in another format along with the exporter

Armature bugs
I have occasionally noticed that quite a few people still seem to be encountering bugs in exporting armature's to torque. I am unsure if this is a bug in blender, or perhaps the exporter itself. Further investigation will likely find the route of the problem.

TSE Bugs
A minor bug with the normal export was resolved with the last update of the exporter. However, it seems that further problems may persist. As my windows machine is now up and running, i am now in a better position to investigate these bugs. Stay tuned.

dtsSDKPlus
As the maya exporter, aswell as potential upcomming exporters seem to be using this sdk, i feel it would be best if the blender exporter followed suit.
This would replace the current python sdk that the exporter uses with a .so / .dll wrapper module to load with python, although the problem is that the module would need to be compiled for each platform the exporter was going to be run on (win, mac, linux).

Other issues / ideas
If anyone has any issues, bugs, or ideas to bring up about a future exporter release, please post them in this thread.
#21
12/10/2004 (7:51 pm)
How many export scripts do you have? and have you tried removing some till you only have 2-3 plus the DTS exporter? (or even just the DTS_exporter)
#22
12/10/2004 (10:04 pm)
Try putting the DTS_Blender.py and all the other package contents inside the F:\blender-2.35a-windows\.blender\scripts directory. Since you've added the Torque_Exporter dir, Blender doesn't know to traverse it.

Looking at your getPath.py, it does show that you have Torque_Exporter\util listed, but it doesn't show the Torque_Exporter. Moving the package contents to .blender\scripts "should" cure the problem.
#23
12/11/2004 (9:25 pm)
Hi Sean, Scott,
Guys, I tried your suggestions but it's still no go. I moved all the DTS exporter files to the /scripts dir, reset PYTHONPATH, removed all of the included exporters (Sean's suggestion). I even tried putting the Torque_Exporter dir in /lib/site-packages and nothing...

I really appreciate your help but I think I'm just going to pony up for a copy of gameSpace and use DI's DTS exporter... Heck if I can learn Blender, gameSpace ought to be a clinch. 8^)

I've got to make some headway with getting my game content prototyped or I'll end up shelving this project again... 8^\
#24
12/11/2004 (10:05 pm)
Well, there is obviously something going on that we're not thinking about. There should be no reason the exporter isn't showing up.

If you want to ditch Blender for GS, that's your call.

As kind of a "duh", you said you moved the exporter to "/scripts". Did you really mean "/scripts" or was it nested inside the blender.app? That's a really important answer.
#25
12/12/2004 (1:04 am)
As for the exporter not showing up :

Make sure you have Dts_Blender.py in a folder that is searched by blender for python scripts; This will vary depending on what option you selected on the blender installer (on windows), or will be something like "~/.blender/scripts" on linux. On Mac OS X, well, i've never tried it myself, so i don't know with any certainty.
You can also pull down the menu bar in blender, and look at the path options. One will be for the python script paths; It will also include a little button for re-scanning for scripts on the said paths.
You also need to add a folder that contains the folder "DTSPython" somewhere on your PYTHONPATH.

As for subsurf's :

I export subsurf's the only way you can atm (unless a new way has been exposed in the python api recently). This way unfortunatly does not retain vertex groups, weights, etc. However, it should suffice for simple, non-animated meshes.

Face limits :

Torque has a limit to how many faces a model can have, due to the data types used for the face data, references, etc.
Realistically speaking though, you shouldn't really have a 10,000 poly model in torque ;)

On a sidenote, there is also an issue with exporting too many faces, or models with badly chosen texture coords (e.g. the automatic 1/1 bounds). The former can be partially solved by using triangle strips;
The latter cannot, and you'll likely see a huge slowdown in torque when using your model. This is due to the exporter exporting too many duplicate vertexes in order to get the texture mapping right.
#26
12/12/2004 (6:16 am)
Quote:As kind of a "duh", you said you moved the exporter to "/scripts". Did you really mean "/scripts" or was it nested inside the blender.app?

@Scott, I moved all the contents of the Torque_Exporter directory and it's subdirs to f:\Blender-2.35a-windows\.blender\scripts which is what I thought you meant? Did I mis-read your directions?

Quote:"This will vary depending on what option you selected on the blender installer (on windows)"

@James, I've been wondering about this. I use the .zip install and manually install the Blender package. I'm going to try the .exe install and see what happens.

Another question: is there any reason why only the "Blender specific" export scripts can't go in the \.blender\scripts directory and the rest of the package in the \lib\site-packages directory? I thought that was how it was normally done with Python.

Thanks for not giving up on me guys! BTW, I meant no negative reflection on James's and others efforts on the exporter script with my gameSpace comment. Just a bit frustrated and tired (late night). 8^)
#27
12/12/2004 (8:44 am)
OK, making headway here! I *think* I've got it working... (I used drive F: to install to. Substitute the drive letter for wherever you installed Blender)

Here's what I did:
1. Install Python 2.3.3 to C:\Python23
2. Install Blender 2.3.5a using the Windows installer to F:\Blender
3. Unzip PythonDTS v4662.pyoct230.85.zip to c:\temp
4. Move C:\temp\Torque_Exporter\Blender_Gui.py, Convert_sticky.py and DTS_Blender.py files to F:\Blender\.blender\scripts
5. Move C:\temp\Torque_Exporter\DTSPython directory to F:\Blender\.blender\scripts
6. Move C:\temp\Torque_Exporter\utils directory to F:\Blender\.blender\scripts

7. From Scott: Edit the DTS_Blender.py script. Change:
"""
n 'Torque DTS Exporter'
b 233
g 'Export'
s 'Export' export
s 'Configure' config
t 'Export to Torque (.dts) format.'

'""
to:

"""
Name: 'Torque DTS Exporter'
Blend: 233
Group: 'Export'
Submenu: 'Export' export
Submenu: 'Configure' config
Tooltip: 'Export to Torque (.dts) format.'
"""
8. Open command window in F:\Blender\.blender\scripts\utils and run 'python getPath.py win32' and note the path.

9. Add the PYTHONPATH variable to XP system variables. Mine looks like:
c:\python23;
c:\python23\DLLs;
c:\python23\lib;
c:\python23\lib\plat-win;
c:\python23\lib\lib-tk;
c:\python23\lib\site-packages;
F:\Blender\python23.zip; *** See note
F:\Blender\.blender\scripts;
F:\Blender\.blender\scripts\DTSPython
F:\Blender\.blender\scripts\utils

*** the getPath.py script reported this as C:\windows\system32\python23.zip. It was wrong and I changed it to what you see here. jh


10. Start Blender, open the Scripts Dialog and choose "update menus"
You should now see a Torque DTS exporter menu item. Load up the example.blend file and export it...

Import into Torque and test. 8^)

Thanks to Scott, Sean and James for pointing me in the right directions.
#28
12/12/2004 (9:21 am)
Hmmmmm, I think I'm having the same trouble. So I'm trying to set my pythonpath. But when I run the getPath.py file, it opens a prompt, but closes imediately. So I tried running it manually via 'python getPath.py win32' But it's a unregonized command.
How do I go about running the getPath.py file?
#29
12/12/2004 (9:35 am)
Enter the full path like 'C:\python23\python getPath.py'.
#30
12/12/2004 (10:22 am)
Thanks.

Ok I've got my pythonpath variable entered. I've got all the scripts and other files in their correct places. I've edited DTS_Blender.py, I've got my scripts path set to .blender\scripts, and I've updated my menus.
But! It still doesn't show up in the menu, and the gui still doesn't run when I try running it manually.

I'm on XP and Blender-2.36RC.
#31
12/12/2004 (4:26 pm)
A couple of suggestions:
Hmm, 2.36RC is a release candidate and may still be buggy. Might want to use 2.35a...
Add C:\python23 to your PATH variable so that it's system callable from any directory.
Remember, if you open a console window to access the command line and then you change the PATH variable, you'll need to close that console and then open a new console window. I forgot to do this couple of times and it nearly drove me nuts trying to figure out why the PATH wasn't taking effect... 8^)
#32
12/13/2004 (6:24 am)
Hi all,

Just a quick query; will the dtsSDKPlus exporter be a standalone app?

One of the probs we're experiencing is that while the geometry exports (almost flawlessly ~ a few holes but that may be user related), the mesh mapping is totally ignored (doesn't appear).

I can do a -show for viewing in the Torque editor, but all I see is a bright yellow artifact of the 3d object.
Perhaps I'm exporting too many objects concurrently out of the Blender scene, is this possible?
My current file is a house with roof, trusses, doors, windows, chimney .. or should I be exporting the items seperately?
#33
12/13/2004 (6:45 pm)
I think I'm having almost the same problem as Shadodragon mentioned above. Updated the menus and all ..
Blender still doesn't see the DTS Exporter ..

Strange thing is ..I can see the exporter in 2.34.,.but not in 2.35a
#34
12/14/2004 (8:45 am)
When you swap

n 'Torque DTS Exporter'
b 233
g 'Export'
s 'Export' export
s 'Configure' config
t 'Export to Torque (.dts) format.'


in ... make sure you go through and replace all of the

'
symbols with the key next to enter on your keyboard.... it switches it out on the boards
#35
12/14/2004 (8:45 am)
Then be sure to update menus
#36
12/14/2004 (9:06 am)
@Richard,

Please email me a copy of your .blend if you are having export problems.

I did intend to alter the blender exporter to use dtsSDKPlus, which is what the maya exporter, and the max2dtsPlus exporters use. However, i am currently stuck in creating a wrapper; It will need a bit more research in order for me to create one and thus start work on getting together a new exporter.

Considering people still seem to have a problem with the exporter appearing on the export menu, i will be updating the zip later to hopefully solve this issue once and for all.
#37
12/14/2004 (10:03 am)
Matthew,

That little trick did it ! As soon as I made the change and fired up Blender.." thar she was !"

.. But .. when I load the DTS into Torque, all I see is a giant yellow neon (Cheese) cube, without its mapping !

well, 50% of the way there ..

James, .. when you say mail you a copy of the .blend, are you referring to the Folder?

~Ciao
#38
12/15/2004 (6:21 am)
Glad to hear it Richard...

I'm pretty sure he means your .blend file

for example the file named Cheeseman

Cheeseman.blend


the mapping issue... maybe you've already done this, but figured I'd throw this at you since I've had issues with this on simple objects that I want a repeating texture to map..

for one... make sure the material... is the same name as the texture file... texture file ex. wood.png

make sure the material is named wood..

also try pressing "F" in the 3d View... then U, choose 1/1 mapping and try it... now this is only for textured objects, like a block of wood or something, not specific mapped places... like LSCM
#39
12/15/2004 (6:35 am)
Matthew,

Thanks for the info; somewhere in the recesses of my mind I do recall something about the mapping procedure you described.

For reference, here's what my subject is supposed to look like ..

www.cybereye-visioneering.com/adev/images/photos/Bldg-02tn.jpg www.cybereye-visioneering.com/adev/images/photos/Bldg-05tn.jpgLarger examples at the 3D assets project page if you're interested.
www.cybereye-visioneering.com/adev/

I'll get that file off to James ASAP !
~ www.cybereye-visioneering.com/smileys/wink.gif
#40
12/16/2004 (7:26 am)
James,

You wrote
Quote:On a sidenote, there is also an issue with exporting too many faces, or models with badly chosen texture coords (e.g. the automatic 1/1 bounds). The former can be partially solved by using triangle strips;
The latter cannot, and you'll likely see a huge slowdown in torque when using your model. This is due to the exporter exporting too many duplicate vertexes in order to get the texture mapping right.

I'm curious about what you mean by badly chosen texture coords and the automatic bounds. What is the best way to choose texture coordinates and what are the automatic bounds? I just looked in Blender and I didn't see anything about the automatic bounds.

One last thing. I read your documentation and in the section in which you talk about the detail32 object. What does the number 32 stand for?
Thanks,