And i did select a some vertices on mesh at 3D-view editor.
And i run script a such as below.
But why not selected a vertex on uv layer?
import bpyme = bpy.context.object.data
uv_layer = me.uv_layers.active.data
bpy.ops.uv.select_all(action=‘DESELECT’)
bpy.ops.object.mode_set(mode=“OBJECT”)
for face in me.polygons:
for li in face.loop_indices:
vi = me.loops[li].vertex_index
if me.vertices[vi].select == True:
uv_layer[li].select = True
print("li : " , li , "vi : " , vi , "uv : " ,uv_layer[li].uv)
for ar in bpy.context.screen.areas:
ar.tag_redraw()
bpy.ops.object.mode_set(mode=“EDIT”)
Question 2]
Bmesh had select_history property.
Maybe Does Uv_layers have select_history property?
for li in face.loop_indices:
me.uv_layers.active.data[li].select = True
There’s also a .select_edge property.
You may be interested into bpy.context.tool_settings.use_uv_select_sync,
set it to True and any selection changes made to me.vertices should be reflected to UV verts/edges.
Note that access to UV layer data isn’t possible in editmode with standard API, you can use the bmesh module and the uv custom layer (bm.loops.layers.uv).
There’s no select_history for UV elements, but if sync is on, you can use the one for mesh elements.
The mesh takes precedence over the UVs - if you enable sync, mesh selection is flushed to UV selection and there’s no way to invert this behavior. If you make UV selections with sync on in the UI, the changes are flushed to mesh selection however. This is not the case for the API (neither standard API nor bmesh module, it needs to be manually set on both).
There are actually no resources to learn such things. I talked to a developer on IRC about the syncing, that’s why I know something about it. You may find some hints in the source code of Blender, but otherwise it’s ideasman’s work and he should know what works how with the python API.