I am in the process of making a little custom export script for my uv textured models in 2.5.4.
At the moment I can see its possible to loop through the mesh data, then faces to export the verts. Now my problems comes when I want to export the faces uv information.
Have a look at this snippet of code first…
import bpy
ob = bpy.context.selected_objects[0] #It is a mesh object with a uv channel
uv = ob.data.uv_textures[0] #Uv data from the 1st channel
print("type =", ob.type, " name =", ob.name) #Show the type and name of the selected object
print("number of faces in mesh data: ",len(ob.data.faces))
print("number of faces in the uv data: ",len(uv.data))
print (ob.data.faces[0]) #First face in the list
print (uv.data[0]) #First face in the uv list
How do I know what face the UV data is for as they are both lists of different types.
From what I can see the len(ob.data.faces) = len(uv.data) always!. Is this true?
If the above is true, does that mean uv.data[0] is the data for ob.data.faces[0]?