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.

http://www.wantonhubris.com/obj-2-map/

Have at it! I think everything will work.

[edit: updated url]
First | Previous | Next | Last
UV Conversion 
This was a lot more of a pain than I thought, lol, but I think I got it working, Here is a beta.

If anyone tries it out:

Before doing the conversion, you have to add all of the textures used by the OBJ file to a Quake WAD, and put it in the same directory as the OBJ. (The reason for this is OBJ2MAP needs to get the Quake texture sizes is order to write the correct texture axis values.)

Secondly, the texture names are read from the "usemtl" lines in the .OBJ. Whatever's after "usemtl" is used as a texture name - directories and file extensions are stripped off first. I'm pretty sure this isn't quite the correct way to read skins from a .obj, I think you're supposed to use a material file, etc..

Finally the output is Valve 220 format only, so this is only usable with Hammer/Jackhammer/TB2/etc.

Future ideas:
- read .mtl file for looking up texture name?
- automatically read in the images referenced by the OBJ and convert them to a WAD file?

I included a sample model (from xonotic) that I was testing with, along with a texture wad, so you can see how things need to be set up for it to work.

source code is here 
NICE Time To Take This For A Spin. 
This should make for some crazy maps in the future if this works as I imagine it too... 
 
Crazy! Can someone post some screenshots of it working? :P How much freedom is actually possible here?

Or, a better question ... what sorts of limitations on UV mapping are there? 
More Complex OBJ Doesn't Work For Me 
I'm getting "Error computing texture vectors" in log.
Ericw I can send you an OBJ if you want. It's quite big. Everything exports except UVs.
Exporting simple box works lol :D

I was looking at code but have no clue why it's not working atm. Need more time to analyse your work :)

Ohhh... and in Jackhammer Y Scale of tex is 0, so you need to change it to 1 manually... 
 
Only limitation I'm aware of is, if the .OBJ contains quads, the tool will just pick 3 verts to compute the MAP texture alignment, and ignore the fourth.

Other than that, it seems to work as expected, it'll shear/rotate/scale/offset the texture as needed so the UVs line up.

I just have this ugly robot model (same one that's included in the obj2map zip) for a screenshot:
https://www.dropbox.com/home/quake?preview=walker.png 
Kreathor 
argh - sure, sending over the .obj would be great. 
Ericw 
I just wanted to export "shit" like this: http://78.47.23.219/head_obj.jpg

Maybe I was too optimistic :D 
Screenshot Derp 
here's the working link: https://www.dropbox.com/s/a9zgelk79nq9zol/walker.png?dl=1

khreathor: dunno, should be possible :P
Thanks, just got your email. 
EricW 
That's pretty insane!! 
 
i think you are too optimistic :P

that would be cool though! 
 
If you listen carefully you can hear the BSP format sobbing gently in the corner. 
Promising But Some Errors.. From 3dsmax 
So I gave it a spin and it does some things right and others wrong with my current setup as far as I can tell.

Here is a screenshot showing my lovely test cylinder in 3dsmax and the resulting data inside TB2.

https://dl.dropboxusercontent.com/u/1849053/OBJ_Mapped_Error.jpg

For starters when I load my wad file it applies all the textures correct. But for some reason in 3dsmax its taking the name of the texture from the material name? And not the actual texture loaded. Oh well I can make that work.

It does get the tiling amount correct for the top but the side faces are skewed. I do believe TB2 supports Valve220 though unless I missed something. I've also included the OBJ output from 3dsmax and the wad file I used.

https://dl.dropboxusercontent.com/u/1849053/cylinder_test.zip 
Hmm Weird 
I think you set everything up correctly, but when I convert your obj it looks fine.
Old build of TB2 by any chance? Double check in Jackhammer? 
Can Confirm... 
I got same results with cylinder as Skiffy...
Tested on Jackhammer 1.1.700
Log full of "Error computing texture vectors".
I just wonder if it's not another problem with dot and comma conversion. In some EU countries we use comma instead of dot, to point floating part. During computation Parse is doing wrong conversion or something like that and outputs rounded results or throw exception. That's why I added "Culture" thing to force dot... but I found maybe one place in the new code where you can add this, but it shouldn't matter tbh. Gonna check it in a moment.

EricW can you sens us MAP file with this cylinder? 
Ah Thanks For The Hint 
yep.. confirmed it is a comma floating point issue, will fix it 
OK Should Be Fixed. 
I updated the download in post #66 
Idk Anymore... 
Still not working properly for me... I think I'll debug it step by step, after I finish other stuff. Can you upload cylinder MAP for me? I wanna see how far values are from proper map file. 
Argh 
So... 
What is a good simple (as in learning curve) modeller to use for this? I've tried TB, Quark, and JH / Hammer to make maps over the years. But have never tried using a modelling program (other that POVray with Moray). 
Sooo Many Choices 
Hmmm if you start from nothing? 3dsmax, Maya, Modo... Cinema4d.... Blender? 
 
I guess Blender ... it's the only free modeling app, isn't it?

I use MODO for everything. 
Blender, No Question 
 
Got It... 
I just lost 8h of source debugging, line by line, with calculator and shit, to realize, it was all fault of "Axis Aligned?" checkbox... -_- fckin' checkbox...

@#$%!!!

Results are amazing man... <3

https://pbs.twimg.com/media/CRK0TILWcAEZB2W.jpg:large

You deserve a medal and sixpack of a beer!

I think new era of Quake mapping just started :D 
Oh Man 
sorry you had to go through all that debugging, but awesome that you found the problem and it works! argh, I must have always been testing with "Axis aligned" unchecked.. 
Axis Aligned?? 
I must be missing something in TB2 then? my models are still messed up :( 
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.