Game Development Community

3DS to .DTS w/Blender -- My .DTS is only 333 bytes, why?

by John Klimek · in Artist Corner · 05/03/2006 (8:00 pm) · 7 replies

I've followed the video tutorial on how to export from Blender to Torque but I'm having some problems with .3DS models that I've imported into Blender.

Here is what I'm doing...

1) Open Blender 2.40
2) File --> Import --> 3d Studio Max (.3ds)

[Object appears fully textured and everything inside of Blender]

3) Create "empty" named Shape.
4) Create "empty" named Detail32.
5) Select Detail32, then Shape and [Create Parent]
**6) Select imported 3d object, then select Detail32 and [Create Parent]
7) Export to Torque (.DTS)

[File is only 333 bytes]


I think the problem might be occuring at step 6. When I select the imported object sometimes I only get a part of it. Maybe the imported model has been broken up into several objects? Do I need to select them all?

What can I be doing wrong?

All I want to do is convert a bunch of .3ds files into .dts... is there an easier way?

#1
05/03/2006 (8:04 pm)
Yeah, many models you import are broken down into separate meshes as far as blender is concerned.

After you import a model, select it with the right mouse and if you only select part of it, it hass imported as separate meshes. You need to join the meshes then. Select all the meshes you want to join in your favorite way and press CTRL-J and answer yes. Then do the parenting voodoo and export.
#2
05/04/2006 (4:19 am)
Ok, I think part of my problem might have been that I was parenting my mesh to Shape instead of Detail32. I've fixed that and sucessfully exported a mesh... (but it wasn't joined so it was just part of the 3d object)

However, when I join the meshes together and then export them, the exporter crashes... (after about 60 seconds of processing and "finalizing geometry") The console says an exception was thrown...

Also, how do I export the texture along with the mesh? (remember that the texture was imported from the .3ds file so I don't have a standalone texture [eg .png] file)

Oh, also.... the mesh was HUGE in Torque Showtool. Do I have to scale it down in Blender first or something?
#3
05/04/2006 (10:20 am)
Quote:However, when I join the meshes together and then export them, the exporter crashes... (after about 60 seconds of processing and "finalizing geometry") The console says an exception was thrown...
www.garagegames.com/mg/forums/result.thread.php?qt=42563

Quote:Also, how do I export the texture along with the mesh? (remember that the texture was imported from the .3ds file so I don't have a standalone texture [eg .png] file)
Extract it from 3ds and save as a file. This is only way i know now.

Quote:Oh, also.... the mesh was HUGE in Torque Showtool. Do I have to scale it down in Blender first or something?
Correct. I can't recall the scale now (0.01?), but you have to scale it down in Blender or Torque script (scale variable of shape).
BTW.: 1 Blender unit == 1 Torque unit
#4
05/04/2006 (11:33 am)
Thanks for the reply...

I don't think I'm using VTK because I never installed anything except Blender v2.41 (and v2.40, because the 3DS importer seems to be broken in 2.41)

Maybe my model has too many faces or meshes? (as noted in the thread linked above)

Joining them together (CTRL-J) doesn't help this at all? How can I "join meshes or triangles" to help my problem?

Also, can I export the texture from blender or must I use 3dsmax to do that? (do I have to export the model from blender in a special way so the DTS finds the standalone texture file?)

Again, sorry for all of the questions...
#5
05/04/2006 (12:00 pm)
Ok, it sounds like you've imported a fairly high resolution mesh of some sort. I'm not specifically aware of a hard limit to the number of faces or verts in a DTS mesh, but I do know that some of the numbers involved are represented with shorts, meaning a max of 32K or 64K.

The other problem you might be running into is duplicate vertices. When you merged the parts of the mesh into one mesh, you likely created a mesh with lots of vertices at the same place since those vertices on the edges of the sub-meshes had to be duplicated in the adjacent sub-meshes. You can do WKEY and then 6 (Remove Doubles) in edit mode on the mesh to remove these duplicate vertices.

If you do have something with lots of faces, you're going to want to reduce that to between 1,000 and maybe 3,000 to 5,000 triangles ... depending on your use of the model. Remember if your mesh is mostly made up of quads (4 sided faces), whatever you see for the face count in blender has to be doubled as all those quads will each be made into two triangles. Most quality rendering meshes will be mostly composed of quads and have very few triangles so if you're seeing 25,000 faces in blender, that means 50,000 faces/triangles in TGE and that's a lot of faces for TGE in one mesh.

You can try using the Decimate modifier to reduce the numer of faces in the mesh, however you aren't very likely to be happy with the results, especially if you're going to try to animate the mesh.
#6
05/04/2006 (12:24 pm)
Quote:Also, can I export the texture from blender...
Well... you can, but it isn't _exactly_ exporting. You can render this texture on plane for example. Maybe you can write a python script for blender for exporting packed textures... or maybe someone did this already. I don't know. Rendering textures is the solution I use. ;)
#7
05/12/2006 (5:18 am)
Maybe try opening an example file that will export a cube or something sucessfully. Then import your 3ds and and select all the 3ds objects (remove duplicates for good measure) and then replace the cube with those objects (remember, only those thing parented will be exported).

As for "exporting" a material - if you mean just make Torque draw a DTS with a texture, just make sure the "material" name in Blender is the same as the image file being used as the texture. ie if you've got "skin_blue.png" as the source of your texture, then name the material in Blender "skin_blue" and place the png in the same folder as the DTS.

There are a few other things involved but I did do a video tutorial on that too so hopefully it will help you.