Skip to content

Instantly share code, notes, and snippets.

@GainDeveloper
Created May 9, 2021 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GainDeveloper/cb8c9097c251332fa0c46301c5c18085 to your computer and use it in GitHub Desktop.
Save GainDeveloper/cb8c9097c251332fa0c46301c5c18085 to your computer and use it in GitHub Desktop.
Takes Y axis diff of a morph and saves it as V in secondary UVs.
import modo
from mlFoundation import mlMath
mesh = modo.Mesh()
uvmap = mesh.geometry.vmaps.uvMaps[1]
morphMap = mesh.geometry.vmaps.morphMaps[0]
with mesh.geometry as geo:
for vertex in geo.vertices:
yPos = 0
morphPos = morphMap[vertex.Index()]
if morphPos is not None:
yPos = morphPos[1]
vertex.setUVs((0, yPos), uvmap=uvmap)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment