Wings3D-to-BZW Exporter Update

Discussion, updates, modifications, etc for the various map editors...
Post Reply
User avatar
optic delusion
Special Forces
Special Forces
Posts: 950
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Wings3D-to-BZW Exporter Update

Post by optic delusion » Sun Mar 22, 2009 8:40 pm

SEE THE TENTH POST IN THIS THREAD FOR AN EVEN NEWER VERSION OF THE PLUGIN

Trepan released the source of the wings-to-bzw plugin. I took the source to a wings forum, where i met Optigon, who is a wings developer. He compiled the plugin with the latest version of erlang, and was nice enough to make some changes eliminating that pesky bug where exported coordinates might have exponential values too small for bzfs to parse. All numbers exported from the plugin are now truncated to four decimal places.
Optigon was really ausom when he added the the plugin to official wings3d source repository. That's right, in the future, the wings-to-bzw plugin will be pre-installed when you download Wings3D.
The source is released under the terms of Wings' BSD license. If you want a copy, get it there.

Here is the compiled plugin as it stands 3-22-09. It works with Wings3d v99.53.
The easiest way to install it is:
LEAVE IT IN TAR.GZ FORMAT. Do not expand the file when you download it.
Open wings, and choose File>>Install Plugin.
SEE THE TENTH POST IN THIS THREAD FOR AN EVEN NEWER VERSION OF THE PLUGIN
Attachments
wings2bzw-v99.53.tar.gz
Thanks Trepan and Optigon
(25.71 KiB) Downloaded 252 times
Last edited by optic delusion on Sun Mar 29, 2009 3:22 am, edited 1 time in total.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.

User avatar
claytonghobbs
Private First Class
Private First Class
Posts: 272
Joined: Thu Jan 10, 2008 1:45 am
Location: The Fourth Dimension

Re: Wings3D-to-BZW Exporter Update

Post by claytonghobbs » Mon Mar 23, 2009 4:12 pm

I downloaded and installed this plugin succesfully, but I can't find how to save something as bzw. How do I do this?
FKA Ratfink

User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1403
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom
Contact:

Re: Wings3D-to-BZW Exporter Update

Post by Spazzy McGee » Mon Mar 23, 2009 5:45 pm

Choose file>Export>BZW
"Life is what happens to you while you're busy making other plans." - John Lennon

User avatar
optic delusion
Special Forces
Special Forces
Posts: 950
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Wings3D-to-BZW Preferences.

Post by optic delusion » Tue Mar 24, 2009 3:37 am

You will see a little box next to File-->export-->bzw, selecting it will show the export preferences. There are ten options. Here's a list, and the suggested usage.

1. One group per material: This should usually be on. (but it doesn't really matter. Maybe a tiny bit faster if it's on?)
1a. If it's on, your materials look like this... One matref and all faces after that will use it.
matref example
face
vertex 0 0 0
normal 1 1 1
texcoord 2 2 2
end ## all further faces use the same matref, until another matref is specified.
1b. If it's off your faces look like this.... Each face has the matref inside it
face
vertex 0 0 0
normal 1 1 1
texcoord 2 2 2
matref example
end ## Each face has the matref inside it

2. Vue D' Esprit Workaround: Leave it turned off. I don't even know what this does. All i know is it's a workaround if your wings exhibits a certain bug. Mine never had the bug, so i leave it turned off. In wings' preferences-->misc you will see some other workarounds you might want to use if your wings is buggy.

3. Tesselation. Should almost always be set for triangulation. What it does is break any face that is not a triangle, into triangles. BZFlag likes triangles! As a matter of fact, I usually triangulate the mesh before exporting , that way, WYSIWYG. If your mesh is already triangulated, the triangulation export option does nothing.
The only reason you might want quads is for drawinfo, or other advanced techniques.

4. Swap Y and Z axes: ALWAYS ON! In BZFlag the up direction is called Z. In Wings the up direction is called Y. When we make the export, we swap Z and Y, and up stays up. If you don't use the swap, your exported mesh will be laying on it's side.

5. Import Scale: Import does not work in the wings2bzw plugin. What you will do is import from obj format, using this procedure.
5a. Join a BZ server.
5b. use command /saveworld -o name.obj This saves a map in obj format, placing it in the same place as saved bzw's.
5c. Use wings' File-->import-->Wavefront (obj) Do not forget to swap Y-Z axes in obj prefs.
5d. After you import, you will see an object named bzground. This will cause problems on export, so i usually delete it right away. The same with teleporters. (optional)

6 Export Scale: You gotta use your judgment here. Import and Export work together. Here's how I usually do it.
Wings has that ground plane, it is centered at 0 0 0, It is a square 20 by 20 units.
Bzflag has a default worldsize, it is centered at 0 0 0, It is a square 800 by 800 units.
So i do a little math, and it turns out that if I import a default-sized BZWorld at scale 0.025, it fits perfectly on wings' ground plane.
Now when I export the mesh back to bzw, I use scale 40. The mesh turns into a bzw that is the same size as the one i started with.
I find that importing an obj at scale 0.025, then exporting to bzw at scale 40 works perfect for me. You can use whatever scales you want.

7. Subdivision Steps: I think i know what this does. I will edit this when i'm 100 percent sure. Don't want to put out inaccurate info.

8. Export normals: Yes, you want this! If you select wings' View-->Show-->Normals, it becomes apparent what they are. You can think of normals like this... If a shot bounces off of a face, it uses the normal to calculate ricochet angle. (you can edit a bzw to put in strange normals, and strange ricochets happen, but tanks can get stuck easily when they land on the face)

9. Export UV coordinates: Yes, you want this! If you bothered to uv-map the object, you want to use it! On the other hand, if you are not using a texture, texcoords are not needed.
9a. if you are exporting in obj format for conversion to drawinfo, the mesh must be FULLY uv-mapped. Ideally, there will be an equal amount of v,n,t (vertex,normal, texcoord). Every face needs complete v,n,t for modeltool drawinfo conversion. You might be able to get around this requirement by using di-machine, but i do not recommend di-machine.

10. Default Texture File Type: PNG, of course.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.

User avatar
Wreckage
Private First Class
Private First Class
Posts: 108
Joined: Sat Sep 23, 2006 6:07 pm
Location: Junkyard

Re: Wings3D-to-BZW Exporter Update

Post by Wreckage » Wed Mar 25, 2009 12:08 am

I am still learning to use wings, and I am unfamiliar with how to execute this stuff above.

4. How do you swap them? I found it right after I read this but then I could not find it again. :(

6. You said to use "scale 40", how do you input that number. I know you can hit tab and it will ask for a percentage but I don't think that is it, 40% makes it smaller of course.

8-10. Not sure where to find these setting either.

If it matters I have the plugin above and have wings version 0.99.04a.

Thank you!
Image

User avatar
optic delusion
Special Forces
Special Forces
Posts: 950
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: Wings3D-to-BZW Exporter Update

Post by optic delusion » Wed Mar 25, 2009 12:29 am

When you use the wings menu File-->Export-->BZFlag, you will see a little box next to BZFlag.
Selecting that box will show the plugin's preference pane.

Image

There is a tutorial that takes you through the steps of making a small Doghouse. Spend 90 minutes with it. It's truly worth it. It takes you through most of the major concepts in wings.
http://www.wings3d.com/tutorials.php
Here's a video!!! http://www.wings3d.com/doghouse.php
The tute called "Filling a Hole" is also important for BZMappers.

UV-Mapping (also called texture mapping, or texcoords), links are here. The barrell tute is all you need to get started. http://nendowingsmirai.yuku.com/topic/2 ... -info.html


P.S.
those of you who have been following the wings-to-bzw plugin through history might get a chuckle when they see a mention of a bug in wings v0.98.34, in the barrel tute.
Last edited by optic delusion on Thu Mar 26, 2009 1:19 am, edited 1 time in total.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.

User avatar
Wreckage
Private First Class
Private First Class
Posts: 108
Joined: Sat Sep 23, 2006 6:07 pm
Location: Junkyard

Re: Wings3D-to-BZW Exporter Update

Post by Wreckage » Wed Mar 25, 2009 10:18 pm

Thanks very much, I didn't even think about the little boxes. And even a screenshot :D The swap axis option certainly fixes the trouble I had been having (oh, the great disappointment of my model being sideways).

And what a coincidence that I have been trying to learn texturing recently! I'll be sure to look at those.

Thanks Optic Delusion!

EDIT: I can't seem to find the PDF file anywhere, in the download there is only what I believe is the executable, no luck in the wings folder either. I use linux btw. Perhaps I could find it somewhere else or you could post it? I'd appreciate it.
Image

User avatar
optic delusion
Special Forces
Special Forces
Posts: 950
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: Wings3D-to-BZW Exporter Update

Post by optic delusion » Thu Mar 26, 2009 1:22 am

You are welcome, Wreckage. I am happy to do whatever i can.
I edited my post above to answer your question.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.

User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 677
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Re: Wings3D-to-BZW Exporter Update

Post by allejo » Fri Mar 27, 2009 11:27 pm

Thanks so much Optic, Trepan, and Optigon. The plugin works great modeltool is great but not much work for me :D (I'm to lazy) the plugin makes exporting so much easier. thanks optic!
Here's my personal website and my open source projects are available on GitHub; I work on a lot of cool things.

Image

User avatar
optic delusion
Special Forces
Special Forces
Posts: 950
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

INSIDE POINTS!

Post by optic delusion » Sun Mar 29, 2009 3:48 am

Thanks to Optigon we now have a newer version of this plugin. He has added a new preference checkbox which will include an "inside" tag in each object automatically. There is some volumetric testing to see if it's a valid object, but it's untested and actual performance may vary. I was talking to Trepan, and he is hoping improve BZFlag's world parsing to remove the necessity for these inside tags, eliminating the need for this new plugin feature.
The plugin's BZW Import feature has been disabled in favor of obj import, but much bzw import code remains in the source. Perhaps it can be useful, at some point in the future.

Again, It's covered under Wings' BSD lisence, and you should now be able to get a copy of the source from the official Wings repository.
HOPEFULLY FINAL VERSION--NOW ADDS INSIDE TAGS
Attachments
wings2bzw-v99.53.tar.gz
DO NOT DE-COMPRESS. keep it tar.gz format.
(27.18 KiB) Downloaded 266 times
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.

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

Re: Wings3D-to-BZW Exporter Update

Post by trepan » Sun Mar 29, 2009 6:42 am

Don't think you understand the "inside" problem, it is not a parsing issue.
P.S. Neither is it a matter of hope ;-)

User avatar
optic delusion
Special Forces
Special Forces
Posts: 950
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: Wings3D-to-BZW Exporter Update

Post by optic delusion » Sun Mar 29, 2009 11:01 am

So there you have it from the man with the plan.
Soon we will not need these inside tags at all.

Well, it's got the clickbox to turn them on and off. You can use it for now.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.

User avatar
claytonghobbs
Private First Class
Private First Class
Posts: 272
Joined: Thu Jan 10, 2008 1:45 am
Location: The Fourth Dimension

Re: Wings3D-to-BZW Exporter Update

Post by claytonghobbs » Wed Apr 01, 2009 5:46 pm

I still can't export anything as bzw with this. I haven't a clue why it doesn't work.
FKA Ratfink

User avatar
optic delusion
Special Forces
Special Forces
Posts: 950
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: Wings3D-to-BZW Exporter Update

Post by optic delusion » Wed Apr 01, 2009 7:23 pm

You must be doing something wrong. Try this.
Trash and delete your existing copy of wings.
Get a copy of wings 0.99.53
Re-download the exporter and do no expand it. Keep it in tar.gz format.
It should work. If it does not, give us some more info about your setup.

Windows Vista users are having problems with wings' dependance on OpenGL.
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.

User avatar
claytonghobbs
Private First Class
Private First Class
Posts: 272
Joined: Thu Jan 10, 2008 1:45 am
Location: The Fourth Dimension

Re: Wings3D-to-BZW Exporter Update

Post by claytonghobbs » Thu Apr 02, 2009 12:01 am

Okay, I'll try downloading wings again. My problem might have been that I installed wings as root, but ran it as a normal user to install the plugin.
FKA Ratfink

coma-R
Private
Private
Posts: 1
Joined: Sat Jan 16, 2010 1:19 pm

Re: Wings3D-to-BZW Exporter Update

Post by coma-R » Sat Jan 16, 2010 1:37 pm

Hi
is thera a way to import .BZW files in Wings?

thanks
coma-R

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

Re: Wings3D-to-BZW Exporter Update

Post by trepan » Sat Jan 16, 2010 5:06 pm

1. Start a server with the map:
bzfs -world mapname.bzw

2. Join the server:
bzflag localhost:5154

3. Save the map in OBJ/MTL format
/saveworld -o filename

4. Import the OBJ/MTL into Wings3d


Something along those lines should do the trick.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests