Game Development Community

Blender Collada Exporter

by Robert Rice · in Torque 3D Professional · 07/03/2009 (6:59 am) · 11 replies

Do Collada files need to be v1.4.1 to be imported into T3D? I've got various Skethup models exported to Collada1.4.1 that I can import just fine. I am trying to get the Blender Collada exporter to produce a model that I can import into T3D. I first tried with the version of the exporter that came installed with Blender 2.48a, which exports to Collada v1.4.0. The model shows up in the file browser in T3D, but when I add it, the manipulator handles appear, but the model is not visible. I downloaded a free Collada viewer and the model shows up just fine there.

There is a newer version of the Blender exporter (0.3.159) that says it will export to v1.4.1, which I downloaded and upgraded to, but my models still export to v.1.4.0. I went through Blender's user preferences to refresh the script; still exports to v.1.4.0.

I've got Python 2.5 installed, if that helps.

Any help is appreciated. This is getting frustrating.

#1
07/03/2009 (9:34 am)
I export from Blender using the 1.4.0 plugin (version: 0.3.160).
#2
07/03/2009 (9:39 am)
I think scale is not well defined in collada, try scaling the objects exported from the blender by a large value and see if they become visible. It may be that the blender has a different idea of how big a colada size unit is.
#3
07/03/2009 (9:40 am)
Yeah, I've found models following the standard Blender scale come out very small in Torque. You'll definately want to scale it up.
#4
07/03/2009 (9:49 am)
I almost forgot. Make absolutely sure you have the Triangles button selected (I don't believe it is by default). If you don't, you'll get behavior similar to what you are describing.
#5
07/03/2009 (10:58 am)
Ah, yep...I had to scale it by about 200. Thanks!
#6
07/04/2009 (5:36 pm)
Robert,
I had the same problem. I edited the Blender exporter script to include the scale factor so that I don't have to adjust it every time.
#7
09/17/2009 (1:14 am)
Cool! How did you do that?
#8
09/17/2009 (1:49 am)
Actually I found the difference was only 100.

But having said that, Blender's standard DAE exporter makes a right pig's ear of the nodes (detail, collision, etc) .... but after checking various random forums around the interwebs, there may be hope of a fully functioning DAE exporter come Blender 2.5 ... with a bit of luck.
#9
09/17/2009 (3:12 pm)
BTW Sort of on topic. How are you guys setting up blender scale for T3D?
#10
09/17/2009 (5:31 pm)
1 Blender unit (the smallest square) is 1cm.
Works fine for DTS export, as long as that is the scale you're using in-game, and that it entirely relative.

Note Collada export which is 100x smaller ... but Blender's Collada Exporter is a bit of a pig's ear. It refuses to acknowledge nodes correctly, so LOD and Col just get mangled.

Having said that, I've got my Blender DTS scale into PureLight as a Blender Collada, and then exported out with PureLight's Collada Exporter at the same 1 to 1 scale.
#11
09/17/2009 (11:04 pm)
John,
Its been awhile since I've used it, but believe this is all you need. Look in .blender/scripts/bpymodules/collada/ImExtranslator.py around line 320. Change:
daeAsset.unit.name = 'centimeter'
daeAsset.unit.meter = '0.01'
To:
daeAsset.unit.name = 'meter'
daeAsset.unit.meter = '3.0'

I don't recall offhand why I changed the second parameter to 3.0, not 1.0.