Page 1 of 1

Wings3D-to-BZW Exporter Update

Posted: Sun Mar 22, 2009 8:40 pm
by optic delusion
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

Re: Wings3D-to-BZW Exporter Update

Posted: Mon Mar 23, 2009 4:12 pm
by clarahobbs
I downloaded and installed this plugin succesfully, but I can't find how to save something as bzw. How do I do this?

Re: Wings3D-to-BZW Exporter Update

Posted: Mon Mar 23, 2009 5:45 pm
by Spazzy McGee
Choose file>Export>BZW

Wings3D-to-BZW Preferences.

Posted: Tue Mar 24, 2009 3:37 am
by optic delusion
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.

Re: Wings3D-to-BZW Exporter Update

Posted: Wed Mar 25, 2009 12:08 am
by Wreckage
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!

Re: Wings3D-to-BZW Exporter Update

Posted: Wed Mar 25, 2009 12:29 am
by optic delusion
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.

Re: Wings3D-to-BZW Exporter Update

Posted: Wed Mar 25, 2009 10:18 pm
by Wreckage
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.

Re: Wings3D-to-BZW Exporter Update

Posted: Thu Mar 26, 2009 1:22 am
by optic delusion
You are welcome, Wreckage. I am happy to do whatever i can.
I edited my post above to answer your question.

Re: Wings3D-to-BZW Exporter Update

Posted: Fri Mar 27, 2009 11:27 pm
by allejo
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!

INSIDE POINTS!

Posted: Sun Mar 29, 2009 3:48 am
by optic delusion
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

Re: Wings3D-to-BZW Exporter Update

Posted: Sun Mar 29, 2009 6:42 am
by trepan
Don't think you understand the "inside" problem, it is not a parsing issue.
P.S. Neither is it a matter of hope ;-)

Re: Wings3D-to-BZW Exporter Update

Posted: Sun Mar 29, 2009 11:01 am
by optic delusion
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.

Re: Wings3D-to-BZW Exporter Update

Posted: Wed Apr 01, 2009 5:46 pm
by clarahobbs
I still can't export anything as bzw with this. I haven't a clue why it doesn't work.

Re: Wings3D-to-BZW Exporter Update

Posted: Wed Apr 01, 2009 7:23 pm
by optic delusion
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.

Re: Wings3D-to-BZW Exporter Update

Posted: Thu Apr 02, 2009 12:01 am
by clarahobbs
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.

Re: Wings3D-to-BZW Exporter Update

Posted: Sat Jan 16, 2010 1:37 pm
by coma-R
Hi
is thera a way to import .BZW files in Wings?

thanks
coma-R

Re: Wings3D-to-BZW Exporter Update

Posted: Sat Jan 16, 2010 5:06 pm
by trepan
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.