you're almost there.
This is just me thinking/coding out loud, untested, but maybe it helps slightly
import maya.OpenMaya as om
def getPointArray(dagNode, components):
dagNode.extendToShape()
fn = om.MFnMesh(dagNode)
pts = om.MPointArray()
fn.getPoints(pts, om.MSpace.kWorld)
return pts
def implantPtPosition(dagNode, components, pts):
dagNode.extendToShape()
fn = om.MFnMesh(dagNode)
indices = om.MIntArray()
fnSingle = om.MFnSingleIndexedComponent(components)
fnSingle.getElements(indices)
for i in xrange(indices.length()):
fnMesh.setPoint(indices[i], pts[i], om.MSpace.kWorld)
sel = om.MSelectionList()
srcDagNode = om.MDagPath()
tgtDagNode = om.MDagPath()
components = om.MObject()
om.MGlobal.getActiveSelectionList(sel)
sel.getDagPath(0, srcDagNode, components)
sel.getDagPath(1, tgtDagNode)
pts = getPointArray(srcDagNode, components)
implantPtPosition(tgtDagNode, components, pts)
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/ba616320-5365-4d5c-8784-f356710b9e21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.