Skip to content

Instantly share code, notes, and snippets.

@GainDeveloper
Last active September 21, 2023 12:01
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/bf15fe1f75e0067bc0fc61e97f0f2a47 to your computer and use it in GitHub Desktop.
Save GainDeveloper/bf15fe1f75e0067bc0fc61e97f0f2a47 to your computer and use it in GitHub Desktop.
mlMeshCopyToMorph.py
import modo
from mlFoundation import mlMath
meshes = modo.Scene().selectedByType('mesh')
source = meshes[0]
target = meshes[1]
indexToPosition = {}
with source.geometry as geo:
for vertex in geo.vertices:
indexToPosition[vertex.Index()] = vertex.Pos()
morphMap = target.geometry.vmaps.morphMaps[0]
with target.geometry as geo:
for vertex in geo.vertices:
newPos = modo.Vector3(indexToPosition[vertex.Index()]) - vertex.Pos()
morphMap[vertex.Index()] = newPos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment