c-d-a / io_export_qmap

.map exporter for Blender
GNU General Public License v3.0
84 stars 18 forks source link

Getting error exporting "terrain" #9

Closed motorsep closed 1 year ago

motorsep commented 1 year ago

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 1 year ago

Thanks. I should really stop testing with the grid off. Fixed in https://github.com/c-d-a/io_export_qmap/commit/deb945ee5fb0ed0ff825ed1b5535e685748b20c0 I figured there's no real need to snap a user-defined variable in this case, verts are already snapped by that point.

motorsep commented 1 year ago

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

c-d-a commented 1 year ago

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

motorsep commented 1 year ago

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 1 year ago

Well, you were closer than I was, mine was a false lead (TB limits Q1 maps to +-32k units). Should be fixed in https://github.com/c-d-a/io_export_qmap/commit/e360420e3bf82f276f6a6688d6527ed6b626fc87 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.

motorsep commented 1 year ago

Seems to be working, thanks!