News | Forum | People | FAQ | Links | Search | Register | Log in
OBJ-2-MAP V1.1
So I added a few new features to my OBJ-2-MAP utility and put together a small web page explaining how to use it.

This is a utility that can take OBJ files exported from any modeling app and convert the geometry inside into Quake brushes.

Have at it! I think everything will work.

[edit: updated url]
First | Previous | Next | Last
It's just the way of it. OBJ2MAP isn't doing anything hardcore magical ... it's just converting one file format into another. So there is some burden on the modeler to make sure the geo is Quake friendly to begin with. 
until you add it you're going to be fielding these concerns until the end of time :)

see: everyone asking sleepwalkr why their map leaks or whatever "in trenchbroom" 
re: "this producing that", the black plane on the piece on the right side extends to seal off the solid.

Capping aside, breaking geometry to group of convex shapes by hand, opens gate for human error. Not to mention might be extremely time consuming.
Yeah, one possible way is build a bsp tree out of the concave geometry, which makes slices that gives you convex pieces. But the downside is it will probably make ugly slices that a human wouldn't choose. 
From What I Saw So Far 
in convex shapes with gaps, every open edge will be extended until it intersects with something.
In case of cube with one side removed, all faces a parallel, thus continue forever.

But say we remove top face of the cube and then scale up bottom face. This will produce a pyramid by extending faces until intersection point.
For me this is magic! That kinda blows my mind and imagination goes wild.

For example.
Maybe I'm completely wrong here and think that easy things are hard and vice versa, but I'd guess that tool is already creating geometry that wasn't there in OBJ file and if it can detect intersection the same way it can detect the ... uhm, lack of it, to create caps using last known finite vertices.

Alas my knowledge of magic is insufficient to imagine "perfect solution" for solving problem with concave geometry. 8/ 
"but I'd guess that tool is already creating geometry that wasn't there in OBJ file"

Technically, no. It's creating plane definitions in the resulting MAP file. The infinite geo and such that you're seeing is being created by the map editor you're loading that MAP file into ... 
not all faces are parallel, but their extrusion direction. 
Well now you destroyed all the magic, mate. 
Sorry. Just trying to interject some reality. :P

felt like reposting this again.

You can make valid cubes by just having 6 triangles. You need those cutting planes or indeed it goes on forever. Once you get the logic its easy to build brushes. 
Webpage To Download Is Gone 
There is nothing there at

Anywhere else to download the latest compiled version? 
"index Was Out Of Range" Error 
Hi, I created a terrain mesh in roblox studio and exported it out in order to test this tool, the unmodified version works just fine however it's very high poly so it creates a fuckton of brushes (about 5.6k) obviously I want less so I put it into blender and ran it through the remesh and decimate modifiers to reduce the poly count but this new low poly version won't convert, it just gives a "index was out of range. Must be non negative and less than the size of the collection" error and i don't quite know why, tested with both extrusion and spikes with depth of 1 
Error Message 
************** Exception Text **************
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at OBJ2MAP.MAPCreation.LoadOBJ(MainForm _MainForm, String[] fileLines, EGRP egrp, StreamWriter streamWriter, List`1& _Vertices, List`1& _Faces, List`1& _UVs, List`1& _Brushes, Single scale, Char[] separator1, Char[] separator2)
at OBJ2MAP.MainForm.GoButton_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 
I have absolutely zero chance of being able to debug the code, and given how the download is served off I suspect nobody else will either. So my idea is to see if the bug can be worked around.

If you try running the Blender tool with a different level of decimate modifiers (maybe start with a very low level of alteration) does the same error still strike? If not, try incrementing the levels until the bug strikes or you have something you can work with.

If not, check if just importing into blender and re-exporting without any modifiers causes the crash. If so, might have to rule Blender out entirely, if not then alternative modifiers are the order of the day. 
Depth of 1 is the possible suspect. Try 8 or more.
The larger the faces, the higher the chance that a pyramid would end up as a degenerate brush (i.e. an original face coincides with one of its extruded ones). Since you're increasing face area, increase the depth accordingly.

Also make sure to triangulate the mesh, I don't think OBJ2MAP checks for planar faces. 
Try using this:

also few tips:
1) Triangulate whole mesh;
2) Set all normals outside;
3) UV it - can be automatic;
4) best to treat 1 blender unit as 1 quake unit, so scale your mesh properly;
5) apply position/rotation/scale before export

When you apply all changes above, you should get flawless conversions. 

Didn't realise there was a version that could do UVs. That's amazing. Going to port this into a Blender exporter after HWJam (unless that already exists as well). 
UVs works only in valve220 format 
As promised, here's a .map exporter for Blender 2.80

Exports either individual faces as pyramids, or objects as convex brushes. Uses material names for texture assignment and material image size for scaling. Supports UVs both in standard Quake and in Valve220 format (adapted from EricW's implementation for OBJ2MAP). Offers custom grid. Allows saving to clipboard.

The exporter ensures that the brushes are convex and the faces planar. You don't have to triangulate the meshes in advance, but in some cases it can help with UVs (e.g. with mid-edge vertices). There's room for improvement, but it should work fine as is.

Standard format UV export is lossy (no shearing). I don't really expect anyone to be using it over Valve220 anyway, but it should produce decent results for id1-style detailing. Single-axis curves should be fine, no miracles though.

Only tested in Trenchbroom for now. Might need to change precision for other editors. Let me know if it works/breaks elsewhere. 
That is an amazing plugin, Chedap! Thank you so much for what you do. It works really really well! 
Installing the .py file through the plugin menu in Blender 2.80 or 2.91 like normal and it doesn't show up. Does this not work anymore? 
Hi, I'm trying to convert a level from Unreal Gold and it's full of Infinities and NaNs.

Blender plugin needs "division by zero" protection in one place. 
@Tintin: the plugin is a single python script. That's what you should download (rather than a .zip) and point to in the Blender's "Install..." dialog.

@crystallize: I have added a check for missing images. This prevents the error, but you should not expect sane UVs on export, since without the files there's no way for the exporter to determine the scale. 
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.