Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Sculpty exporter for Wings 3D

Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
05-18-2007 10:06
After a bunch of pounding and digging through wings3d's source (the documentation for writing plugins for it is non-existant) I have more or less completed it. There are still a few things I want to to it but this version should work.

The import dialog has a radio button for the different styles, only Sphere is implemented, some sort of error will be thrown if you try the others (no idea what it will be).

I plan to make the exporter smarter.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
05-18-2007 11:07
You beat me to it, Strife! Cool.

I don't understand why making all the faces triangles helps. Can you elaborate?
Cindy Crabgrass
Crashed to Desktop
Join date: 9 Sep 2006
Posts: 158
05-18-2007 11:15
/me looks at the .erl source :eek:

OMG... this Language is almost as weird as FALSE
_____________________
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
05-18-2007 11:27
From: Cindy Crabgrass
/me looks at the .erl source :eek:

OMG... this Language is almost as weird as FALSE

It's really not obfuscated, Cindy -- just different. It's a (mostly) functional language that makes extensive use of pattern matching (like Prolog) and recursion, so it can look pretty strange if your experience is only with imperative languages.
Cindy Crabgrass
Crashed to Desktop
Join date: 9 Sep 2006
Posts: 158
05-18-2007 11:39
I wonder why the finest Free 3D Programs (Blender and Wings)
have to use the most exotic Plugin / Script Languages.
It would be a lot easier with simple, well known stuff like C++ or lua.
OK, maybe i learn Blender - Python ... but erlang ? no way.
_____________________
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
05-18-2007 11:45
Perhaps they are the finest BECAUSE of the languages they are written in.
Cindy Crabgrass
Crashed to Desktop
Join date: 9 Sep 2006
Posts: 158
05-18-2007 11:58
From: Omei Turnbull
Perhaps they are the finest BECAUSE of the languages they are written in.


/me looks at sources...

Blender looks like C... ok

Wings... :eek: OMG ... .erl

/me faints
_____________________
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
05-18-2007 12:03
Strife, I notice that if I export a model and re-import it with the default settings, the rotation is changed. (Also, the normals are in the wrong direction, I think. But the normals are OK if I import with a flip.), Presumably, the default option for importing should be the inverse of exporting. Does my treatment of export coordinates need to change, to better align with SL?
lencho Schwartzman
Registered User
Join date: 21 Dec 2006
Posts: 5
05-18-2007 14:49
you might try UVMAPPER from a OBJ export of wings its great and I use it alot in the Poser world.

I cant get the exporter to work on my MAC which is where I SL from. I'll keep trying. and if I have time use UVmapper to test.
lencho Schwartzman
Registered User
Join date: 21 Dec 2006
Posts: 5
05-18-2007 15:14
Oh the URL for UVMapper...www.uvmapper.com what else!

I tried it and the export worked...now to see if Its gonna work as a sculpy or not
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
05-18-2007 15:15
For anyone who is interested, I updated the exporter on the first post of this thread to implement importing of sculpties.
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
05-18-2007 18:38
From: Omei Turnbull


8 sections and 7 slices (will create an 8 x 8 bitmap)
16 sections and 15 slices (will create a 16 x 16 bitmap)
32 sections and 31 slices (will create a 32 x 32 bitmap)
64 sections and 63 slices (will create a 64 x 64 bitmap)





:confused:

Omei, something has been puzzling me for quite some time and I can't contain myself any longer.

So here goes:

When specifying slices, why is it 7,15 and 31 slices and not 8,16 and 32?
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
05-18-2007 18:46
From: 2k Suisei
:confused:
When specifying slices, why is it 7,15 and 31 slices and not 8,16 and 32?

I'm mapping the two poles to all the pixels in the top and bottom rows of the bitmap, and each set of vertices at a constant "latitude" to a row of pixels in the bitmap. Because of the poles, 31 latitudinal "slices" maps to 32 rows. On the other hand, it takes 32 longitudinal "segments" to generate 32 columns, because there are no longitudinal poles.

Does that make sense?
2k Suisei
Registered User
Join date: 9 Nov 2006
Posts: 2,150
05-18-2007 19:31
From: Omei Turnbull
I'm mapping the two poles to all the pixels in the top and bottom rows of the bitmap, and each set of vertices at a constant "latitude" to a row of pixels in the bitmap. Because of the poles, 31 latitudinal "slices" maps to 32 rows. On the other hand, it takes 32 longitudinal "segments" to generate 32 columns, because there are no longitudinal poles.

Does that make sense?


This was your 31st post. I think you and the number 31 have something going on.

..and no, it didn't really make sense. But I shall continue to think about it.


I want a new brain.. :(
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
05-18-2007 20:02
From: Omei Turnbull
Strife, I notice that if I export a model and re-import it with the default settings, the rotation is changed. (Also, the normals are in the wrong direction, I think. But the normals are OK if I import with a flip.), Presumably, the default option for importing should be the inverse of exporting. Does my treatment of export coordinates need to change, to better align with SL?


That probably has to do with how I read it as BGR instead of RGB (and the writer not doing the same). I should probably make a conditional flag for that based on the order. I'll fix it.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
05-18-2007 20:50
From: 2k Suisei
This was your 31st post. I think you and the number 31 have something going on.

This post proves I have no bias. :-)
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
05-18-2007 20:56
From: lencho Schwartzman
I cant get the exporter to work on my MAC which is where I SL from. I'll keep trying. and if I have time use UVmapper to test.

Make sure you have Wings version 0.98.36, not 0.98.32a. Post #11 in this thread might be relevant to you.
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
05-18-2007 21:01
From: Strife Onizuka

I plan to make the exporter smarter.


What thoughts did you have for that, Strife?

I was going to look at the way Wings handles texturing, and if there was anything there that could be improved for sculpties.
Hypatia Callisto
metadea
Join date: 8 Feb 2006
Posts: 793
05-18-2007 23:14
From: Ryozu Kojima
I can't for the life of me get Wings to give me a useable UVMap on my .obj export for use in Deep Paint 3D?

Does anyone have a clue?


take the sphere as it was generated by Wings

I exported it as obj and then imported it into UVMapper, and applied a quick spherical mapping, making sure to fill the entire uvspace. This will match to how it will map in SL.

I used Y axis and gaps in map, spread facets at poles. You can then use it to paint on in programs like Deep Paint and Zbrush. When taking the file into PS, just run a plugin like Flaming Pear's Solidify on it to fill the gaps at the poles. I still have to test to see if the poles are handled well enough in this method, but should be good enough to work out the kinks in PS where the map gaps.
_____________________
... perhaps simplicity is complicated to grasp.
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
05-19-2007 01:22
Ok I've made the changes so that it can export & import circularly. And I'd come up with a hack (that took a huge amount of work because Erlang refused to do what I wanted it to do and the error messages were typically useless) so that it can export arbitrary sized spheres (normal and sculpted).

What I've come to hate about Erlang is the lack of compile time type checking. Even basic type checking that created warnings would make my life easier.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
05-20-2007 10:12
From: Ryozu Kojima
I can't for the life of me get Wings to give me a useable UVMap on my .obj export for use in Deep Paint 3D?

Does anyone have a clue?

Have you not been able to find the UV mapping functionality? Or you try it and it doesn't give what you need?

http://www.arcadiadesign.it/NeoEngine/neoengine.emedia-solutions-wolf.de/neoengine-api/html/WingsUVMapping.html
is a concise summary of how to do texturing in Wings. Google for "Wings 3d textures" or "Wings 3d UV mapping" to find more detailed tutorials.

If the problem is that even after you create the UV map, Wings isn't exporting it in a format you can use, can you amplify on that?
Omei Turnbull
Registered User
Join date: 19 Jun 2005
Posts: 577
05-20-2007 10:20
From: 2k Suisei

..and no, it didn't really make sense. But I shall continue to think about it. :(

Try this. Create a sphere with 8 sections and 7 slices. "Slices", in Wings parlance, are the solid pieces that would be created if you cut the sphere along the horizonal edge loops. If you count the slices, you'll see there are 7, as you requested. But when mapping the model to a sculpty bitmap, I am using vertices, not slices. Count the vertices between the north and south poles, and you will see that there are 8.

If you ask for 8 slices instead of 7, you will get 9 vertices from pole to pole.
Simon Nolan
I can has ur primz?
Join date: 28 Mar 2006
Posts: 157
05-20-2007 14:42
From: 2k Suisei
..and no, it didn't really make sense. But I shall continue to think about it.

Heh heh... fencepost error! Think of it this way 2k Susie. You have a 80 foot fence, with fenceposts 10 feet apart. How many fenceposts are there? Sketch it out and you'll see why eight is not the right answer.

On to other things... Has anyone figured out how to get this to work on Macs? I got to the plugins directory buried in the applications bundle (whose idea was that?) and dropped Omei's original plugin inside. Exporting gives me 'Exporter crashed: {badmatch,"Unsupported mesh shape"}'. I started off with a 32x31 sphere, and did some stretching to create an object uncannily like SuzanneC's.

Any ideas?
_____________________
Simon Nolan
I can has ur primz?
Join date: 28 Mar 2006
Posts: 157
05-20-2007 14:48
Nevermind on getting it to work... I used Strife's exporter instead of Omei's, and it works perfectly now.

Woohoo! I'm off to sculptie-land!
_____________________
lencho Schwartzman
Registered User
Join date: 21 Dec 2006
Posts: 5
05-20-2007 19:35
OK newest version works in MAC version of wings and UVMapper works also
1 2 3 4 5 6 7 8 9 ... 32