ModelTool for OBJ to BZW conversion

General talk about the map making process.
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

ModelTool for OBJ to BZW conversion

Post by JeffM » Thu Jan 20, 2005 10:01 pm

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 1422 times
Last edited by JeffM on Fri Mar 25, 2005 2:45 am, edited 1 time in total.

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 » Sun Jan 30, 2005 4:41 am

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 » Tue Feb 01, 2005 9:28 pm

so i can convert Blender files into BZW objects with this?
Image

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Post by JeffM » Tue Feb 01, 2005 10:59 pm

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

They are working on the direct blender module now.

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 » Wed Feb 02, 2005 10:46 pm

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 » Wed Feb 02, 2005 10:48 pm

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 » Wed Feb 02, 2005 10:49 pm

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 » Wed Feb 02, 2005 10:51 pm

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 » Wed Feb 02, 2005 11:05 pm

Awsome tool!! Didnt take the time to re-align this, but it made the surface of the bzw object smooth ;)
Attachments
obj_test2.jpg
Object Before
obj_test2.jpg (21.04 KiB) Viewed 4442 times
obj_test1.JPG
Object After
(96.39 KiB) Downloaded 690 times
Image

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Post by JeffM » Wed Feb 02, 2005 11:20 pm

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 :)

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 » Thu Feb 03, 2005 1:17 am

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 » Fri Feb 04, 2005 10:32 am

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: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Post by JeffM » Fri Feb 04, 2005 5:17 pm

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.

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 » Fri Feb 04, 2005 5:39 pm

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 » Fri Feb 04, 2005 5:45 pm

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 » Fri Feb 04, 2005 5:48 pm

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 » Fri Feb 04, 2005 9:32 pm

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: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Post by JeffM » Fri Feb 04, 2005 9:55 pm

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.

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 » Fri Feb 04, 2005 10:10 pm

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 » Fri Feb 04, 2005 10:31 pm

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 » Fri Feb 04, 2005 11:02 pm


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

Post by trepan » Fri Feb 04, 2005 11:18 pm

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 » Fri Feb 04, 2005 11:35 pm

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 » Fri Feb 04, 2005 11:40 pm

Thanks for the help, works perfectly now.

User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5173
Joined: Fri Dec 13, 2002 4:11 am
Location: https://discord.gg/NN9uAvx
Contact:

Post by JeffM » Sat Feb 05, 2005 2:07 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest