-1
$\begingroup$

How to get the values (in the screenshot) when i have the whole object selected in python? How do I get the value in the screenshot in python? enter image description here

$\endgroup$

1 Answer 1

5
$\begingroup$

This will get the values of every vert

import bpy, bmesh
from bpy import context as C

me = C.active_object.data

# edit mode
bm = bmesh.from_edit_mesh(me)

# object mode
# bm = bmesh.new()
# bm.from_mesh(me)

uv_lay = bm.loops.layers.uv.active
for vert in bm.verts:
    for loop in vert.link_loops:
        uv = loop[uv_lay].uv
        print("Loop UV: %f, %f" % uv[:])

https://docs.blender.org/api/current/bmesh.html#customdata-access

$\endgroup$
6
  • $\begingroup$ I need to get the value of all vertices together, not each one separately, and so that they can be moved together. Thanks for the answer, but it's not that $\endgroup$
    – tormozzzz
    Commented Nov 21, 2021 at 17:04
  • $\begingroup$ @tormozzzz: then you should edit and improve your question, because how should karan or anybody else know what you mean if you don't write it in your 2 sentence question!? $\endgroup$
    – Chris
    Commented Nov 21, 2021 at 17:48
  • $\begingroup$ @chris - this is in the question(see screenshot) $\endgroup$
    – tormozzzz
    Commented Nov 21, 2021 at 18:19
  • $\begingroup$ Nope, it is not clear. You wrote : how do I get the value? You didn’t wrote: how do I get the values. $\endgroup$
    – Chris
    Commented Nov 21, 2021 at 18:45
  • $\begingroup$ @Chris - value -> tuple(x,y), values -> x,y; Everyone can understand in their own way, but the meaning is the same ) $\endgroup$
    – tormozzzz
    Commented Nov 21, 2021 at 18:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .