Hi , I am new to blender and python, I am exporting the 3D model to an objective C header file using the below script, with out UV mapping the script exports vertex position, and normals . But with UV mapping the script gives error# mesh texture poly has no attribute uv # can you pls.
let me know how to correct the script (found on the web)

#i know there has to be an easier way to do this, but i'm too lazy to look it up
for next_obj in objs:
if next_obj.type == 'MESH':
mesh = next_obj

print("Writing Object")

for i in current_scene.objects:
i.select = False #deselect all objects
mesh.select = True
current_scene.objects.active = mesh #set the mesh object to current
bpy.ops.object.mode_set(mode='EDIT') #Operators
bpy.ops.mesh.select_all(action='SELECT')#select all the face/vertex/edge
bpy.ops.mesh.quads_convert_to_tris() #Operators
current_scene.update()
bpy.ops.object.mode_set(mode='OBJECT') # set it in object