c-d-a / io_export_qmap Goto Github PK
View Code? Open in Web Editor NEW.map exporter for Blender
License: GNU General Public License v3.0
.map exporter for Blender
License: GNU General Public License v3.0
I have a bunch of architectural models, all already exported as ASE with materials, to be used in Doom 3 (or idTech4 in general). I would like to make my map with those model in Blender and then block out rooms with caulk, separated by visportals (brushes behind/inside the models).
What would be the best way to export .map so that when I load it in Dark Radiant (or whatever editor of choice), models in the Editor are located/oriented where they were located/oriented in Blender (when add-on exports func_static entities, they should reference proper models and have proper origin/rotations)
When exporting terrain to TriSoup Brushes it becomes very hard for blender to handle more than a few thousand individual meshes.
Since backfacing pyramideon extrusion costs a lot more .bsp filesize and collision planes - I've decided to go with TriSoup for terrain extruded on Z and snapped to grid otherwise.
When exporting this mesh I have to split up each of these brushblocks by using separate by loose parts. This process alone takes about half an hour.
I was wondering if it's feasible to have the exporter create brushes from discjunct convex surfaces inside the mesh - skipping the split by loose parts workflow - however not in a sense that the plugin overtakes this process, but can avoid it alltogether - saving on time.
Hey there.
When exporting to the Valve 220 format there needs to be one extra newline/paragraph at the end of the file, or else Hammer Editor won't be able to open the generated map file. Other editors might be immune to this issue, however Hammer is not.
It's an easy fix at line 354 I think.
Anyway, thanks for the good work with this addon!
I'd like to build a map using modular meshes. Instead of exporting geometry, I'd like to be able to export .map with entities only, which would reference entity class, origin, reference ASE or LWO model on the disk and a few parameters.
This way I could load this .map file into DarkRadiant, for example, and have level automatically assembled from previously exported ASE/LWO meshes.
Could you please extend this add-on to do that ?
If it's actually already possible, how do I go about exporting this kind of setup ?
Thanks
P.S. I just noticed it's related to this issue I posted a while back #13
I know this may be out of the scope for id Tech but Source is based on it after all and the map format is very similar so it would be nice if we got VMF support
I probably overstayed your welcome with all these reports ๐ , but, would it be possible to add support for DarkRadiant layers (using maybe Collections) ?
Hello again, thanks again for this wonderful addition to the idtech3 mapping front!
I'd like to ask if you would consider adding an option to export continous grid meshes with UVMap to PatchDef.
I built a Geometry Nodes based Patchmesh Evaluator and am currently in the process of adding Geo Nodes based Tooling to mimick the same tools we have in Radiant, as in adding, removing rows, transposing the patch for inversion, custom attribute transfer as well as mimicking the same subdivision criterions the renderers use.
Here are a few screenshots to get a grasp of what I'm talking about. This would allow to preview and edit patches in realtime without the drawbacks of missing UVs like it's currently the case with the NURBS based approach.
this works by take some faces and convert to one brush and repeat
I attached a simple scene I've been working on. Geo exports fine, but I am wondering how can I export info_player_start with the map. This setup is basically to aid visualization of the size of the entity and the direction it's facing.
The expected output:
{
"classname" "info_player_start" << default, but would be nice to change it in Blender because it can vary
"name" "info_player_start_1" << Entity's name (default)
"angle" "90.000000" << get this from parent cube rotation (yaw)
"origin" "-108 -82 11" << get this from the world location of the Empty
}
Would it be feasible to use vertex groups to assign detail vs structural to the exported brushwork in face export mode?
Would require splitting all faces into tris prior to this and hoping the vertex group assignments still cary over in this process.
Paired with https://github.com/SomaZ/Blender_BSP_Importer this tool would be very handy in slowly carrying over the idtech3 toolkits to Blender.
Like the title say, could we request a version of the script to import instead, are there any plans for it in sight?
I think I found a way to represent pretty much every connected mesh (whatever you'd actually call that) as a patch. Use the following Blender operations on the scene with the specified settings:
So basically then the only problem is fixing irregular mesh / mesh with divots at what should be corners. Any part of a mesh with the 'lightning' shape is what needs fixed. I'm working on that solution I just don't have time at the moment since I have to go to work. But basically you fill where the corner should be with necessary vertices then apply the 2 steps above to the new mesh.
Something like this won't work because the faces don't all meet (left hand side cut-quad doesn't meet the right quad with
its entire length):
Whereas something like this should work:
I'm working on a tool that converts Source Engine maps (which use the Valve 220 format) to Call of Duty maps (which use the standard UV format). It basically generates the geometry by intersecting planes and creating patch meshes (similar to Quake 3's bezier patches) instead of brushes. Having a lot of meshes in the map makes it very difficult to edit it though, so I decided to borrow a small part of this repo, but it doesn't yield very accurate results, so I was wondering if there were any plans to improve the part where it exports brush faces with Quake's standard texture coordinate format.
I've tried to use the part of this repo where it converts UV coordinates of three vertices to Quake's standard format in my own tool and did some tests with some brushes. Simple brushes that only have straight faces seem to work well as seen in the pictures below.
This one is from Hammer Editor.
And this one is from CodRadiant.
When I tested it with more complex brushes, I realized it doesn't always yield accurate results.
The inaccuracies become more obvious when it is tested on an actual map.
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
i need to know how to do this
Would it be possible to write out each plane as a patch? I'm thinking of a way to reduce the number of brushes that are written out by this program. The program currently doesn't work very well with concave mesh. This is the format I'm looking for:
// entity 0
{
"classname" "worldspawn"
// brush 0
{
mesh
{
toolFlags splitGeo dontSplitLights;
$default
lightmap_gray
5 5 16 8
(
v -168 -120 8 t 0 -0 -10.5 7.5
v -168 8 8 t 0 -32768 -10.5 -0.5
v -168 136 8 t 0 -65536 -10.5 -8.5
v -168 264 8 t 0 -98304 -10.5 -16.5
v -168 392 8 t 0 -131072 -10.5 -24.5
)
(
v -74 -120 8 t 24064 -0 -4.625 7.5
v -74 8 8 t 24064 -32768 -4.625 -0.5
v -74 136 8 t 24064 -65536 -4.625 -8.5
v -74 264 8 t 24064 -98304 -4.625 -16.5
v -74 392 8 t 24064 -131072 -4.625 -24.5
)
(
v 20 -120 8 t 48128 -0 1.25 7.5
v 20 8 8 t 48128 -32768 1.25 -0.5
v 20 136 8 t 48128 -65536 1.25 -8.5
v 20 264 8 t 48128 -98304 1.25 -16.5
v 20 392 8 t 48128 -131072 1.25 -24.5
)
(
v 114 -120 8 t 72192 -0 7.125 7.5
v 114 8 8 t 72192 -32768 7.125 -0.5
v 114 136 8 t 72192 -65536 7.125 -8.5
v 114 264 8 t 72192 -98304 7.125 -16.5
v 114 392 8 t 72192 -131072 7.125 -24.5
)
(
v 208 -120 8 t 96256 -0 13 7.5
v 208 8 8 t 96256 -32768 13 -0.5
v 208 136 8 t 96256 -65536 13 -8.5
v 208 264 8 t 96256 -98304 13 -16.5
v 208 392 8 t 96256 -131072 13 -24.5
)
}
}
}
I am getting this error in Dark Radiant when importing simple 64x64x64 cube map :(
Exported map and reference map are attached,
Blender_Doom3_testmap.zip
The "Terrain" export option appears to throw an exception in the later versions of Blender (3.4.1+).
Also, is it possible to specify a different axis for Terrain? That would be handy for cliffsides, etc.
I started making a map in Blender (more or less a proper map) and quickly found out that it's a chore to adjust grid settings while modeling.
Would it be possible to make something like a floating icon that opens up a panel (or maybe right-click menu instead of icon) with predefined grid settings (1,2,4,8,16,32,64,128,256,512,1024,2048, 4096, etc.) and grid subdiv settings ?
Would it be possible to add functionality that would break up marked/selected concave meshes into convex ones (if not on export, maybe as a pre-export function, initiated with a button in the UI or something) ?
Would it be possible to add functionality to export into .map where individual meshes export according to mesh option set via custom properties on that mesh and with meshes that have no custom property set to be exported according to mesh option selected in the add-on's UI ?
This would allow for a lot greater flexibility when making complex maps (as some objects/meshes might require specific mesh option).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.