Vertex Proxy: u2

u2
  • gets/sets the u position of the vertex on the second UV map (UV/Image Editor).

Type:

  • float number
Sample Code

############################# get the vertex u position on the second 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)

# get u position of the vertex UV map
u_pos = vert.u2

Sample Code

############################# set the vertex u position on the second 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)

# set u position of the vertex UV map
vert.u2 = 1.0