Easy conversion of OBJ files into Quake compatible MAP files.
Created by Warren Marshall. Mirrored here for archival purposes as his website has been down now for a few years. This is an invaluable tool that converts obj files to Quake .map files with a surprising degree of accuracy.
Documentation
There's not a lot to know here but I'll run through the basic options and what they do.
Overview
Create a model in your favorite modeling app and export it as an OBJ file. We'll use a cube for demonstration purposes.
OBJ-2-MAP should support various formats and options for OBJ files. If it can't read your OBJ file send me the file and I'll see if I can make it happy.
Conversion Options
I won't go over every field but it's worth talking about a few of the specifics in detail here. First up, the method of conversion:
Standard
Takes each chunk of geometry in the OBJ file and converts it as if it's a set of planes, directly into a Quake brush format.
Extrusion
Takes each polygon in the file and extrudes it backwards along the normal to create a brush. So this means that every polygon becomes a unique brush.
Spikes
Essentially the same as Extrusion except it creates a spike on the back of each polygon instead of a straight extrusion.
Axis Aligned
This checkbox determines how the extrusion methods will behave. If unchecked, extrusions will happen along the polygon normal. If checked, extrusions will happen along the closest cardinal axis direction. This is useful things like terrains where you want every triangle to extrude straight down rather than along it's normal.
Other Options
These options control various behaviors of the conversion process, most of which are pretty self explanatory.
The "Copy To Clipboard?" is a huge time saver if you have a map editor that supports pasting Quake MAP format from the clipboard, like Trenchbroom. Just convert the OBJ and paste the results into Trenchbroom. Done!
"Class" is helpful if set to something like func_detail or func_wall. This saves time and frees you from forgetting to change it later.
"Decimal Places" allows you to control the precision of the verts during conversion. Don't touch this unless you're not getting the results you want.
"Visible" faces are those in the OBJ file while "Hidden" faces are the new ones created via the extrusion methods. This is a quick way to set those new faces to something that can get easily clipped away during map compilation.
Problem?
If you run into an OBJ file that this program can't read correctly or have questions, let me know. Odds are I won't be adding any major features but bugs sucks.
warren.marshall@epicgames.com
Thanks!
Tried the tool on Quaternius.com, the model RailwayTrack_Straight.obj in the hopes of getting the train tracks natively in .map.
The converted .map somehow had only 1 piece of the track.
Tried some options to see if that work made it work better (like extrusion and spikes). One of the resulted in a crash.
This was my experience with 1 obj model, maybe it was the .obj model somehow.
The idea for this tool is great.
Try splitting the model up into smaller pieces. Also scale the model up larger. Often the reason why the editor crashes is because it's trying to open a .map with the vertices too small. That's what I've found tends to work.
I'm trying to convert bob-omb battlefield (https://www.models-resource.com/nintendo_64/supermario64/model/668/), which i assumed would work since it's a relatively simple model. but when i convert with standard, trenchbroom says
Brush is empty (line 3)
Brush is incomplete (line 25)
Brush is empty (line 31)
Brush is incomplete (line 65)
Brush is incomplete (line 69)
Brush is incomplete (line 77)
Brush is incomplete (line 83)
Brush is incomplete (line 172)
Brush is incomplete (line 203)
Brush is empty (line 219)
Brush is empty (line 433)
Brush is incomplete (line 471)
Brush is empty (line 485)
Brush is empty (line 531)
Brush is empty (line 561)
Brush is incomplete (line 591)
Brush is empty (line 673)
Brush is incomplete (line 787)
Brush is empty (line 817)
Brush is incomplete (line 839)
Brush is incomplete (line 861)
and then when i try to convert it with either extrusion or spikes, i get the error
"Unhandled exception has occurred in your application. If you click continue, the application will ignore this error and attempt to continue. If you click quit, the application will close immediately.
Object reference not set to an instance of an object"
there's also a details box with this in it:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at OBJ2MAP.XVector.Multiply(XVector _V, Double _Scalar)
at OBJ2MAP.MainForm.GoButton_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.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)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
CodeBase: C:
----------------------------------------
OBJ2MAP
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: C: 2 map/OBJ2MAP.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9181.0 built by: NET481REL1LAST_C
CodeBase: C:
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9214.0 built by: NET481REL1LAST_B
CodeBase: C:
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: C:
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: C:
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9214.0 built by: NET481REL1LAST_B
CodeBase: C:
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: C:
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.8.9037.0 built by: NET481REL1
CodeBase: C:
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" ></system>
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
It's likely too big. Try separating it into smaller pieces. Or try scaling the model larger before exporting.
Do you have the source code? I'm interested in recompiling it for BSD.
As far as I know it's located here Bitbucket.org
EDIT: I have updated this download to include OBJ2Map 1.3. Which has a bunch of new features like support for Valve map files.