Thank you very much Matthew for your answer.
You help me a lot and you give me a perfect code snippet.
I also searched the equivalent solution for bmesh and I found this:
This code snippet scans the faces, the vertices and corresponding uvs.
import bpy, bmesh
bpy.ops.object.mode_set(mode='OBJECT')
obj=bpy.context.object
bm=bmesh.new()
bm.from_mesh(obj.data)
uv_layer=bm.loops.layers.uv.active
for currentFace in bm.faces:
print("Face index=%s selected=%s" % (currentFace.index,currentFace.select))
if currentFace.select:
for currentVertex,idx in zip(currentFace.verts,range(len(currentFace.verts))):
print(" Vertex index=%s pos=%s selected=%s" % (currentVertex.index,currentVertex.co,currentVertex.select))
print(" UV pos=%s selected=%s" % (currentFace.loops[idx][uv_layer].uv,currentFace.loops[idx][uv_layer].select))
I hope that I don’t commit a mistake with the use of the index idx in the loop (currentFace.loops[idx][uv_layer].select).
I presume that the vertex order in a face (currentFace.verts) is the same than in the loop.
But I’m not entirely sure of that…
Thanks again
++