Blender As3Exporter uv flipping problem.

I have a problem with Blender As3Exporter.
When i export from blender into away3d the faces flip backwards. and don’t know what to do. scaling backwards changes position.

ok i have compared two versions backwards and normals.
Backwards seems to show right coordinates. So i have changed face positions

anyone who wants to check please check it for me or give another solution. Because i don’t like this version.

def export_away3d_220(me, class_name):
file_name = “AS3ExpAway3D220.as”
data_loop = “”
transform_props = “”

for v in me.verts: 
    data_loop += "			v(%f,%f,%f);

" % (v.co.x, v.co.y, v.co.z)

data_loop += "

"

for f in me.faces:
    if me.faceUV:

this part was changes
i have changed verts 2 and 1

data_loop += " f(%i,%i,%i,%f,%f,%f,%f,%f,%f,%f,%f,%f);
" % (f.verts[0].index, f.verts[2].index, f.verts[1].index, f.uv[0][0], f.uv[0][1], f.uv[2][0], f.uv[2][1], f.uv[1][0], f.uv[1][1], f.no.x, f.no.y, f.no.z )
if not me.faceUV:
data_loop += " f2(%i,%i,%i);
" % (f.verts[0].index, f.verts[2].index, f.verts[1].index)

transform_props += "
		x = %f; y = %f; z = %f;

" % (ob_locX, ob_locY, ob_locZ)
transform_props += "
rotationX = %f; rotationY = %f; rotationZ = %f;
" % (ob_rotX, ob_rotY, ob_rotZ)
transform_props += "
scaleX = %f; scaleY = %f; scaleZ = %f;
" % (ob_scaleX, ob_scaleY, ob_scaleZ)

save_file(file_name, class_name, data_loop, transform_props)

it didn’t help anyone other suggestions?

To debug this, it might be better to look at the template file AS3Export/AS3ExpAway3D220.as, or even better at the generated .as file. Basically you need to modify the functions v, f, and/or f2 until they give you the right results. It is easiest to experiment in the generated .as file, and then fix the source code when you know how it should be.

The other thing to check is to recalculate the normals in Blender to make sure they are good.

For a different output type (Haxe/sandy in http://github.com/paulfitz/blender2haxe) I had to do a coordinate transformation to deal with going from a right-handed system to a left-handed system (basically changing some signs and switching some coordinates). I don’t know anything special about Away3D, but if you found you had to switch axes you may also need to change a sign on an axis to get the right results.

Another solution might be to contact Andrea Boschini, the person credited with this part of the code.

Thank you for your reply. I have submitted report on Andrea Boschini’s website but I think he doesn’t have time to look at it.