TD-SDK Shift UVs

From The Foundry MODO SDK wiki
Revision as of 09:04, 16 May 2016 by Ivo.grigull (Talk | contribs)

Jump to: navigation, search


Example of using modo.Polygon.setUV /getUV from the TD-SDK


scene = modo.scene.current()
geo = modo.Mesh().geometry # gets currently selected mesh
uvmap = geo.vmaps.uvMaps[0]
# Shift vertex UVs on all polygons
def shiftUVs (vertex, UVMapName='Texture'):
	for polygon in vertex.polygons:
		u,v = polygon.getUV(vertex, uvmap=UVMapName)
		polygon.setUV ( (u+0.1, v), vertex, uvmap=UVMapName)
vertex = geo.vertices[0]
shiftUVs (vertex)