Hi guys!
I'm trying to push the global vert positions of one mesh to that of
another. Essentially, no matter what I do with either transform, I
want the shape on the second to always look exactly the same as that
of the first (in world space). That's it. Another way to describe it
would be to say - I just want the two objects to be the same, all the
time. I'm getting stumped though, in that it seems I need a dag path
for world space output, and I'm not sure how to get that given the
inputs/outputs I'm working with. Any ideas? Thanks in advance! -J.
class noMovey( omMPx.MPxNode ):
aInShape = om.MObject()
aOutShape = om.MObject()
def __init__ ( self ) :
omMPx.MPxNode.__init__( self )
def compute( self, plug, data ):
inMesh = data.inputValue( noMovey.aInShape ).asMesh()
inFnMesh = om.MFnMesh( inMesh )
ins = om.MPointArray()
inFnMesh.getPoints( ins, om.MSpace.kWorld )
outPoints = om.MPointArray( ins )
outFnMeshData = om.MFnMeshData()
outMeshData = outFnMeshData.create()
outFnMesh = om.MFnMesh()
outFnMesh.copy( inMesh, outMeshData )
outFnMesh.setPoints( outPoints, om.MSpace.kWorld ) # Maya no
likey
data.outputValue( noMovey.aOutShape ).setMObject( outMeshData )
data.setClean( noMovey.aOutShape )
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---