Vertex Proxy: setUV

setUV(uv)
  • Sets the UV coordinates for the vertex.
  • Sets the coordinates on the first UV map.

uv:

  • Type: float list [ u, v]

u:

  • the u position of the vertex on the second UV map (UV/Image Editor)
  • Type: float number
v:
  • the v position of the vertex on the second UV map (UV/Image Editor)
  • Type: float number
Sample Code

############################# set the vertex UV of the first UV map

# import bge
import bge

# get the current controller
cont = bge.logic.getCurrentController()

# get object that owns this controller
obj = cont.owner
 
# Get a list of the mesh
meshList = obj.meshes

# Get the first mesh on the object
mesh = meshList[0]
 
# get the first vertex of the first material
vert  = mesh.getVertex( 0, 0)

# new uv coordinates
uv = [ 0.5, 1.3]

# set the vertex UV of the first UV map
vert.setUV(uv)