c-d-a/io_export_qmap

Getting error exporting "terrain"

Closed this issue · 6 comments

Ugh, I am getting this error trying to export my terrain mesh as terrain type:

Read blend: D:\projects\blender\scenes\steelstorm2\maps\start_terrain2c_lq_export_aas.blend
Traceback (most recent call last):
File "E:\Apps\blender-3.4.0\3.4\scripts\addons\io_export_qmap.py", line 849, in execute
self.process_mesh(obj, fw, template)
File "E:\Apps\blender-3.4.0\3.4\scripts\addons\io_export_qmap.py", line 661, in process_mesh
bottom = self.gridsnap(bottom - self.option_depth)
File "E:\Apps\blender-3.4.0\3.4\scripts\addons\io_export_qmap.py", line 338, in gridsnap
return [round(co/grid)*grid for co in vector]
TypeError: 'float' object is not iterable

Here is .blend file
start_terrain2c_lq_export_aas.zip

c-d-a commented

Thanks. I should really stop testing with the grid off. Fixed in deb945e
I figured there's no real need to snap a user-defined variable in this case, verts are already snapped by that point.

Hmm.. Still not working. Here is the output .map:
terrain_test7_aas.zip

c-d-a commented

It exports without errors now at least, correct? DR complains about "invalid texture matrix", I'll see what that's about in a bit.

When exported for Q1 I see that some geometry gets cut off, so it has something to do with size/precision.
terrain

Right, it exports without issues. But I see some weird stuff in the map file:

brushDef3
{
( -0.78077 -0.26488 0.56589 -28975.83008 ) ( ( 0. -0. 0.30132 ) ( 0.00001 0. -0.46421 ) ) "textures/grid1024gray" 0 0 0
( 0.78077 0.26488 -0.56589 23105.26172 ) ( ( -0. -0.00002 0.50596 ) ( -0.00001 0.00001 -0.53863 ) ) "textures/common/caulk" 0 0 0
( -0 -0 -0 nan ) ( ( 0.00003 0 -0.44831 ) ( 0.00001 0 -0.54049 ) ) "textures/common/caulk" 0 0 0
( -0 -0 -0 nan ) ( ( 0. 0 0.18457 ) ( 0.00001 0 -0.54046 ) ) "textures/common/caulk" 0 0 0
( -0 -0 -0 nan ) ( ( -0.00001 -0. 0.55206 ) ( 0.00001 0. -0.54044 ) ) "textures/common/caulk" 0 0 0

I've never seen "nan" inside .map file

c-d-a commented

Well, you were closer than I was, mine was a false lead (TB limits Q1 maps to +-32k units).
Should be fixed in e360420
Also, at this scale you should probably consider using higher precision. With closest verts being 4k units apart, there's a high chance of them drifting apart between neighboring brushes. Not much to be done about it, either.

Seems to be working, thanks!