hello,
i have tried to get and set vert points from one mesh (‘neutral’) to another with mesh (‘target’) before using this code:
import maya.OpenMaya as om
def getPoints(geo):
sel = om.MSelectionList()
dag = om.MDagPath()
sel.add(geo)
sel.getDagPath(0,dag)
mesh = om.MFnMesh(dag)
vts=om.MFloatPointArray()
mesh.getPoints(vts, om.MSpace.kObject)
return mesh,vts
def setPoints(geo, finalPos):
geo.setPoints(finalPos, om.MSpace.kObject)
#store the vert positions for each mesh
mFnMesh, mesh1Vts = getPoints("neutral")
mFnMeshTarget, mesh2Vts = getPoints("target")
#set the points from mesh 1 to mesh 2
setPoints(mFnMeshTarget,mesh1Vts)
But my problem is i need to adapt this so that it can work on a vert selection of mesh one, rather than all the verts. Is there a way of just storing the specific selected verts from mesh1 and copying they positions to mesh2. Each mesh has matching topology but their shapes are different
if anyone could help my adapt this, i would appreciate it
thanks,
Sam