Prefab V2 bug - flipped down UV map. files included

Software: Away3D 4.x

antonio.lea, Newbie
Posted: 02 June 2012 09:54 AM   Total Posts: 19

First,

Really awesome job on prefab V2.  It looks fabulous and absolutely amazing.
Now about a bug (hopefully minor):

UV is flipped upside down and I have no way to change this in prefab v2.
(modeled via maya and uv, baked through maya).

For now, I would just import the model from prefab v1. and would work fantastically.

 

File Attachments
flipps_if_imported_from_fabv2.zip  (File Size: 384KB - Downloads: 472)
   

Avatar
Fabrice Closier, Administrator
Posted: 02 June 2012 09:54 PM   Total Posts: 1260   [ # 1 ]

—“Really awesome job on prefab V2. It looks fabulous and absolutely amazing.”
Thank you! Glad you like it.

—“Now about a bug (hopefully minor):”
Just tried your model in v2. It is not just a uv issue. There is something “wrong” with your file.
If I load it into AC3D, it even crashes the app! smile

So I took a closer look at your file:

f 25/1/1 26/2/2 28/3/3 27/4/4 1/5/5 2/6/6 3/7/7 4/8/8 5/9/9 6/10/10 7/11/11 8/12/12 9/13/13 10/14/14 11/15/15 12/16/16 13/17/17 14/18/18 15/19/19 16/20/20 17/21/21 18/22/22 19/23/23 20/24/24 21/25/25 22/26/26 23/27/27 24/28/28

Here you go: you have multipolygonal faces. You need to triangulate your model prior to export it.

A typical face looks like this:
f 272/272/272 271/271/271 273/273/273
That a face definition of your model exported as obj by Prefab.
What you look at is a face with indices reference per vertex 0,1 and 2 to uv and normals.
If you would export while using quads, it would be valid as well.
It would look like this:
f 272/272/272 271/271/271 273/273/273 274/274/274

The Away ObjParser ignores some parts of the face info while validates partly others, as a result, the indices are out of sync. Prefab internal checks prevent the app to crash and it does it’s best to display something. While ac3d crashes, probably because it doesn’t have a validation into the face contruct routine.

That Prefab 1 obj parser displays it, is surprising. Especially without a warning. There is some kind of a “doctor” inside (way too expensive for heavy models).

Prefab 2 has one more generic, not extended enough for now (but faster). Basically it doesn’t attempt to fix, it tries to survive and display all what is possible to be displayed. I’m adding on the todo a notice for such case. Your model will be a perfect test case file.

Finally, your mtl is holding a colormaterial definition.
In Prefab 1 / Away 3.x, the parser would ignore your mtl definition.
However, you can see in Prefab 2 and in Away 4 that it does construct this ColorMaterial. If you plan to reexport from Prefab to load in Away3D, then its not a problem, as you will get the propper mtl with the right material. But if you go directly from your editor, then i suggest you do load without mtl. either by commenting out the “usemtl” tag into your obj file or ask the loader to ignore dependencies.

That having said, it is of course possible that some bugs are in parsers here and there. So keep reporting!

Hope it helps

   

antonio.lea, Newbie
Posted: 02 June 2012 10:54 PM   Total Posts: 19   [ # 2 ]

Triangulated the meshes and they work fabulously!  I had no idea I had to triangulate the meshes T.T

As far as the taking out the mtl line reference, this is my work flow.

1.  maya -> uv
2. maya -> bake
3. maya -> import bake jpg
4. maya -> export obj (and spits out mtl + jpg file)

5. prefab -> import obj
6. prefab create new texture material
7. import spitted out jpg (and remove all the other materials from prefab)
8. export via wavefront obj, and check “save dependencies” , “jpgs”.
9. edit wavefront obj and take out the mtl file reference line
10. fun in flash etc..


Thanks so much, I’ve been using your prefab since v1 and already loving v2.

   

Avatar
Fabrice Closier, Administrator
Posted: 03 June 2012 12:05 AM   Total Posts: 1260   [ # 3 ]

I had no idea I had to triangulate the meshes
—> now you do smile

6: if you select the mesh, you can directly drop the jpg from your os on the mainscene, it will apply it (only diffuse maps)

8 you say you want the dependency, and 9 that you remove it?
why no having saves dependency out if you do not want your mesh to have a texture? If you do, Prefab’s mtl will load your map automatically in away.

but if you simply load the obj.. why not use the as3 exports? way smaller files, no loaders, fast inits…

10 of course smile

“Thanks so much, I’ve been using your prefab since v1 and already loving v2.” V2 is still in early stages. You might even love it more in a not so far future smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X