1
$\begingroup$

I want to select some vertices on object and select the same vertices on the Image/UV editor but without the 'selection syn'c as it selects undesired vertices.

I wrote this script but unfortunately it does not return any UV vertices coordinates.

import bpy
import bmesh



obj = bpy.context.active_object
me = obj.data
bm = bmesh.from_edit_mesh(me)
uv_layer = bm.loops.layers.uv.verify()
bm.faces.layers.tex.verify()


bpy.context.scene.tool_settings.use_uv_select_sync = False

for f in bm.faces:
    f.verts[0].select = True
    f.verts[1].select = True

    for l in f.loops:
        luv = l[uv_layer]
        if luv.select:
            print(luv.uv)



bmesh.update_edit_mesh(me)

Thanks in advance

$\endgroup$
2
$\begingroup$

BMLoop.vert


When iterating through the face loops (, which in case below is f.loops), the vertex of each loop element (l), is the vert property BMLoop.vert of the loop. (l.vert).

    for l in f.loops:        
        luv = l[uv_layer]
        if l.vert.select:
            print(luv.uv)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.