ModelTool for OBJ to BZW conversion

General talk about the map making process.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

ModelTool for OBJ to BZW conversion

Post by JeffM »

This is the OBJ converter, built for windows.

It will convert OBJ files that have normals and texture coordinates into bzw maps.

It will convert materials.

It will break objects up into one bzflag mesh object per texture per OBJ group. ( so you can do an entire level in one OJB if you do wish )..

It does work on linux, you just have to get source and build your own.

No it's not documented.

The commandline is

Code: Select all

modeltool SOME_FILE.OBJ
or just drag an obj onto it and it'll convert it.

It will make a new file with the same name just with a BZW extenstion ( replacing any file with the same name that is allready there ).

Best of luck with it.
Attachments
modeltool.zip
updated modelTool to force geometry above Z 0
(60.34 KiB) Downloaded 2131 times
Last edited by JeffM on Fri Mar 25, 2005 2:45 am, edited 1 time in total.
ImageJeffM
User avatar
Gerbil
Private First Class
Private First Class
Posts: 251
Joined: Sat Dec 07, 2002 2:46 pm
Location: Habitrail Tube
Contact:

Well cool

Post by Gerbil »

Good job--thanks!
Politically correct BZ: A kinder, gentler Guided Missile.
User avatar
Sir Lance-A-Lot
Private First Class
Private First Class
Posts: 503
Joined: Tue Jun 29, 2004 12:49 am
Location: Amongst my Computers
Contact:

Post by Sir Lance-A-Lot »

so i can convert Blender files into BZW objects with this?
Image
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

you can export from blender to obj, then convert to bzw yes.

They are working on the direct blender module now.
ImageJeffM
User avatar
RPG
Lieutenant, Junior Grade
Lieutenant, Junior Grade
Posts: 2015
Joined: Fri Sep 17, 2004 2:37 am
Location: Chicago, Illinois
Contact:

Post by RPG »

Here's a comparison between an object before and after the transformation. The .obj file was 48KB, and the .bzw file was 53KB. I only used 4 objects in the design though. The pictures- before and after.
Attachments
joybefore.jpg
The joystick before the conversion
(38.41 KiB) Downloaded 845 times
bzfi0000.png
The joystick in BZFlag after the conversion
(465.39 KiB) Downloaded 864 times
User avatar
Sir Lance-A-Lot
Private First Class
Private First Class
Posts: 503
Joined: Tue Jun 29, 2004 12:49 am
Location: Amongst my Computers
Contact:

Post by Sir Lance-A-Lot »

heeey thas Anim8or - How did you export??
Image
User avatar
RPG
Lieutenant, Junior Grade
Lieutenant, Junior Grade
Posts: 2015
Joined: Fri Sep 17, 2004 2:37 am
Location: Chicago, Illinois
Contact:

Post by RPG »

Lance I got the Anim8or link from you.

I went Object > Export > then saved it as a Wavefront(*.obj) file.
User avatar
Sir Lance-A-Lot
Private First Class
Private First Class
Posts: 503
Joined: Tue Jun 29, 2004 12:49 am
Location: Amongst my Computers
Contact:

Post by Sir Lance-A-Lot »

wow...i thought a tried that already...So the BZW will accept stuff like 3d arches made in there?
Image
User avatar
Sir Lance-A-Lot
Private First Class
Private First Class
Posts: 503
Joined: Tue Jun 29, 2004 12:49 am
Location: Amongst my Computers
Contact:

Post by Sir Lance-A-Lot »

Awsome tool!! Didnt take the time to re-align this, but it made the surface of the bzw object smooth ;)
Attachments
Object Before
Object Before
obj_test2.jpg (21.04 KiB) Viewed 43947 times
obj_test1.JPG
Object After
(96.39 KiB) Downloaded 690 times
Image
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

In bzflag the Z axis is "up", in some editors "Y" is up ( I know in milkshape it is ).

The converter can correct this for you, just add -flipyz as a paramater, and i'll do the 90degree rotation that is needed.

good to see it's being used :)
ImageJeffM
User avatar
Sir Lance-A-Lot
Private First Class
Private First Class
Posts: 503
Joined: Tue Jun 29, 2004 12:49 am
Location: Amongst my Computers
Contact:

Post by Sir Lance-A-Lot »

ah thank you ;) I will use this program a lot ;) Itsa lifesaver.
Image
User avatar
Valoche
Private First Class
Private First Class
Posts: 69
Joined: Fri Dec 20, 2002 5:39 pm
Location: France/Grenoble

Post by Valoche »

Where is the source? Can't find it in CVS.
On my Windows XP, it does not generate any file, anywhere :?
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

the source is in the bzflag source tree, under tools/modeltool/

what are you providing for input?

it should go modeltool "some file/you have/somewhere/thingy.obj"

it needs to end in obj, as it the tool is made to do more then one format, so it keys off the extenstion ( tho it only does obj at the momoent ).

if that dosn't work, please post your obj file so I can see it. There are some features of the OBJ format the tool will not work with.
ImageJeffM
User avatar
Memnarch
Sergeant First Class
Sergeant First Class
Posts: 273
Joined: Mon Jul 05, 2004 10:42 pm
Location: Sorry, I'm a Nowhere Man
Contact:

Post by Memnarch »

Umm.. is there a converter for Linux users, or will there ever be?
Image
brad2901
Private First Class
Private First Class
Posts: 223
Joined: Sun Sep 12, 2004 9:17 am
Location: UK
Contact:

Post by brad2901 »

I'm having some trouble with the anim8or program. I created this 3d 'thing' in it, thne saved it as a *.obj file. When I tried to convert it into a *.bzw file it wouldn't work. It gave me this error:
no valid meshes written from C:\Documents and Settings\Owner\Desktop\test.obj
Anybody know what i've done wrong?
User avatar
SilverFox
Private First Class
Private First Class
Posts: 163
Joined: Wed Oct 06, 2004 6:51 pm
Contact:

Post by SilverFox »

Have you tried compiling it under linux?
User avatar
Gerbil
Private First Class
Private First Class
Posts: 251
Joined: Sat Dec 07, 2002 2:46 pm
Location: Habitrail Tube
Contact:

FYI--Anim8tor

Post by Gerbil »

Anim8tor--Good program to make sure it's compatible with--it's free and a lot easier than Blender for the uninitiated (as in "me").
Politically correct BZ: A kinder, gentler Guided Missile.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

the tool should build on any OS from the sources. I just posted a windows binary here because most windows users don't have a compiler.

Brlcad made the makefiles for *nix so the app should be good on them all, I think even the mac.

Brad2901 post your obj file. There are some things that an OBJ can have that the converter can't convert ( like surfaces, triangle strips and fans ). So maybe your little modeler is doing something like that. The OBJ file is text so if you post it we can see what the deal is.
ImageJeffM
User avatar
Memnarch
Sergeant First Class
Sergeant First Class
Posts: 273
Joined: Mon Jul 05, 2004 10:42 pm
Location: Sorry, I'm a Nowhere Man
Contact:

Post by Memnarch »

Ok, I am probably gonna get yelled at, but can I have a link to the source, please? :roll:
Image
User avatar
DTRemenak
General
General
Posts: 625
Joined: Thu Jan 16, 2003 4:54 am
Location: U.S.
Contact:

Post by DTRemenak »

They're part of the main bzflag source distribution, in the tools directory.
brad2901
Private First Class
Private First Class
Posts: 223
Joined: Sun Sep 12, 2004 9:17 am
Location: UK
Contact:

Post by brad2901 »

trepan
Dev Wizard
Dev Wizard
Posts: 704
Joined: Fri Feb 21, 2003 7:50 pm

Post by trepan »

It would really help if you had a Wavefront OBJ file.
That file is an Anim8or .an8 file. Use object->export
to get a proper OBJ file.

You could also save "test.pdf" from Anim8or, but
I guarantee that Acrobat Reader would choke on it.
User avatar
RPG
Lieutenant, Junior Grade
Lieutenant, Junior Grade
Posts: 2015
Joined: Fri Sep 17, 2004 2:37 am
Location: Chicago, Illinois
Contact:

Post by RPG »

How long did it take you (JeffM) to make this?
brad2901
Private First Class
Private First Class
Posts: 223
Joined: Sun Sep 12, 2004 9:17 am
Location: UK
Contact:

Post by brad2901 »

Thanks for the help, works perfectly now.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Post by JeffM »

RPG
I was bored at work and had a couple hours, so I made the first version in that time. Trepan and some others have made some fixes and changes to it since then, but it's a simple app, so not long.
ImageJeffM
Post Reply