| Author | Comment | ||
|---|---|---|---|
marcin wuu |
lightwave exporter? |
Lead | |
|
(06/23/08 13:12:23) |
I was wondering if anyone from the dev team would care to take a look at the lwo exporter and solve some issues that cause me some pita?
|
||
scorpius |
|||
|
(06/27/08 07:27:44) |
Like what?
|
||
Ran13 |
|||
|
(06/27/08 08:46:02) |
Apparently there is a problem with how Wings writes vertex normals into the LWO file.
Faces end up with flipped normals that are not able to be corrected w/in Lightwave and simply render black no matter what you do. According to marcin, this also happens on some OBJ files exported from Wings and imported into LW, as well. Perhaps Wings is using an OBJ format feature that LW doesn't like... ??? Anyway, he sent me a copy of his problem mesh, and I exported as OBJ, and imported into both Blender and 3dsmaxv6 (using the habware OBJ i/o plug for max) and all was fine. Ran the STL Check modifier on the mesh in max and it reported no errors (checks for open edges, duped faces, spikes, etc). So it's a LW problem, or it's the LWO exporter, or both. Not sure about the OBJ problem though. |
||
marcin wuu |
|||
|
(06/27/08 09:02:53) |
I would bet on lightwave's problem in vertex normal interpretation - apparently after removing some verts from problematic faces the faces are fixed.
Cutting the verts back in lightwave doesnt cause the problem to come back. Another weird thing, on the corrupted faces lightwave creates another face, pointing
other way. But since vert normals are mixed, the other face is also corrupt.
Sometimes single face of an object comes into lightwave with normal apparently flipped. After flipping this face everything looks ok, but funny thing is lightwave still thinks this particular face is corrupt and invoking Align (which in lightwave makes all normals of a given mesh point in the same direction) it flips the face back to wrong direction (which lightwave thinks is right) Another annoying problem of lwo exporter is the x-flipping of the mesh. all lwo's from wings have their x orientation wrong. This is wings problem not lightwaves - Objs come into lightwave with proper orientation. Thats it - i can send you corrupt meshes if you want to give them a look. |
||
scorpius |
|||
|
(06/28/08 08:01:24) |
The LWO exporter doesn't export normals. If one face is flipped, which is impossible in wings, then I'd guess something is wrong with the way LW
interprets the file. There's not much I can do about it.
|
||
marcin wuu |
|||
|
(06/28/08 08:26:39) |
but you see, lwo is lightwave's NATIVE format. to say lightwave interprets its own format wrong is a bit... weird... There must be some information written
into it by wings thats erroneous...
|
||
Ran13 |
|||
|
(06/30/08 08:06:33) |
My thoughts exactly...
Kinda like me saying "I was speaking French to this French person, and they didn't understand me, so I guess they don't know French very well." |
||
marcin wuu |
|||
|
(06/30/08 16:12:07) |
Ok i think i pinpointed the problem. LWO format consists of chunks. most important are point and poly chunks. The point chunk is a series of points
coordinates. then comes the poly chunk that calls upon the point chunk that precedes it to make a polygon. there is a strict rule - the points making a polygon
must start at convex point, and they must be ordered clockwise looking along faces normal. and the corrupt polys have the order wrong. I dont know how the
exporter builds the point chunks, but theres an error sometimes - it happens not only with ngons, it can happen with quads. It also happens with tris, but then
you just get a tri that faces the wrong way - it cant get corrupted obviously, as it only consists of three points. So, anyone willing to tackle this?
|
||
scorpius |
|||
|
(07/05/08 10:07:22) |
Lightwave can indeed mis-interpret its own format, just like people can mis-interpret their native language. It happens sometimes. Remember a few years ago
when Wings, in certain cases, couldn't read back its own *.wings files?
I know for a fact that Modo (written by the creators of LW) has been experimenting with a NORM chunk that contains normals. This is for the purpose of reading LWOs exported from MOI, which is a nurbs modeler. Nurbs models depend on the true surface normals for proper display. Wings & Blender don't care for true normals, and they are content with calculating the average normal, which is less accurate, but for most cases no one will notice. So maybe LW also tries to read the NORM chunk, and if it's not there it can make a mistake. It could be a bug in LW or my exporter or Wings. If you send me a *.wings file that has this problem,I'll take a look because now I'm curious to see what's going on. |
||
marcin wuu |
|||
|
(07/05/08 10:15:41) |
ok, ill do this, but im certain the problem is with the order of the points in the chunk - actually i went through the sdk to see how it works and checked with
the file - it has the points order wrong. The sdk doesnt mention the norm chunk - i think lightwave only calculates normal based on the point order - clockwise
or counerclockwise. I might be wrong however.
Thanks in advance for looking into this, and where do i send the file to? |
||
scorpius |
|||
|
(07/05/08 11:17:03) |
s-c-o-r-p-i-u-s-i-n-b-o-x-c-o-m
I don't want to type it because of spam. I hope you can figure it out. |
||
scorpius |
|||
|
(07/06/08 10:24:27) |
I checked your file (biurowiec.wings) and exported to lwo and obj. They both import into Blender and Wings with no flipped faces. I also dumped the contents of
the exported lwo and all face indices are ordered correctly. The only thing I can think of is that your mesh has some faces that may not be convex. But you
said that the problem also occurs with all triangular, which by nature are convex. If LW still imports it with a few flipped faces, then I'd say LW has a
bug.
|
||
marcin wuu |
|||
|
(07/06/08 10:53:44) |
bare with me for a while longer please - im not your code is wrong or something, its just very annoying, and only happens with wings created lwos - modo and
lightwave never did it to me, unless i deliberately or by mistake made a polygon that had vertex order wrong.
look at this screenshot - lightwave gives each vertex a number, and these numbers have to go in right order for the face to be properly displayed. on the screenshot you can see how they're mixed up...
Im sending you both wings and lwo files that consist of this face only. please take a look at it... |
||
scorpius |
|||
|
(07/06/08 12:51:54) |
No problem at all. I'll bear with you until we solve it.
The file you sent doesn't match the screenshot above; there's no vertex that contains a coordinate with a value of -1.0066 or .8074743. Was that directly imported in LW? |
||
marcin wuu |
|||
|
(07/06/08 13:47:30) |
i moved the verts cause they were too close to each other and the indices wouldnt show
but, damnit, my point order theory is wrong... in the dump point order is correct... and all it takes for the face to become uncorrupted is move any of the points a bit - but not entire face just one point... I will ponder on this further... one more note - modo also imports the face as corrupted... |
||
extrudeface |
|||
|
(07/06/08 15:05:21) |
hadnt read thro it all, excuse me saying some nonsense...could it be two pretty near overlapped faces ? or... have you tried applying a normals operation over
it all just after import?
also... the double facing prob, I don't know way, when brain is malfunctioning like now, only trust in intuition.... can it be model is not triangualted/quadrangulated ? it could cause maybe, some weird stuff like that, from ngons... Other times, (but yep, with other formats) double faces , or, simple duplication of verts, (which often ends in double coincident faces (opposite normals or not)) happen if uvmapping applied, and at some point of export, for format limits, or software from where it comes, or export plugin of it, or import plugin of the other package, or the other package itself, don't understand correct, for whatever, cant have 2 uv coords per single 3d mesh vertex, and create new mesh vertex there, provoking seams, or, could be, double facing, etc. An absolute shot in the dark, but due to few sleep hours, I cannot really think... other than that, the export of wings to lwo, saved my neck in times when the OBJ importer of Blender wasn't as polished as now... (tho perfection is hard to reach....) they're the two formats I trust more for wings export... (hadnt tried much the others, gotta say... )
Last Edited By: extrudeface
07/06/08 15:09:48.
Edited 1 times.
|
||
marcin wuu |
|||
|
(07/06/08 16:03:20) |
no, im afraid no... Lightwave doesnt care for double faces, the object in question is not uvmapped... the verts are single, not occupying the same space etc...
and yet both lightwave and modo say - flatness degenerate - even though the coordinates are perfect for a flat face. all it takes is to nudge any vert and alls
fine... bummer.
|
||
extrudeface |
|||
|
(07/07/08 09:14:07) |
ouch, sounds as huge glitch there...
anyway... if all it takes, is tthat...unles must be that specific face and you need to touch it..maybe some global operation have same effect... curious... "Lightwave doesnt care for double faces" ...how it deals with model that comes with tha problem ? If it can'twork with double faces it deletes one, how does it know which is the correct? does it reallyknow? Or...if it simply "allow" they exist, cant be two coincident are apearing there, almost in same coords, and when you move one put just over the other? sorry if my mind is simply being to dense now.. .which could be... |
||
marcin wuu |
|||
|
(07/07/08 11:26:56) |
lightwave doesnt care as in you can have double triple and thousandfold faces in exactly the same coordinates... Problem is when you try to render it
|
||
extrudeface |
|||
|
(07/07/08 13:01:35) |
yep, I mean, there's usually in every modeler of old skool, a tool inside to recon double faces and delete one... or just weld the verts. Maybe am not
getting the point. The shading errors always ocur in every tool where you have coincident faces. (darkening, zbuffer fight, etc... )
|
||
marcin wuu |
|||
|
(07/07/08 13:29:57) |
even if you delete the coincident faces you are left with one that is probably corrupt. But you are missing the point - there's not always multiple faces -
this is only an example where i deleted all the faces in wings to export to lwo. In a normal situation you have normal mesh with no coincident faces verts etc.
and some of the faces are corrupt, just like that, for no apparent reason. theres nothing wrong with the mesh itself. same mesh imported to max maya or xsi is
ok. but lightwave (and modo) says flatness degenerate, period.
|
||