I suspect that you would have to have the worldMatrix fed in as an additional input attribute.
The basic problem, though, is that 'worldSpace' is always relative, and I'm not sure what you want it relative to. Since it seems like you want this shape "echoed" in multiple spots in the dagTree, each eventual "output" destination in the dag would have to feed this node it's world matrix (or, more likely, it's inverse world matrix) into some sort of 'destinationWorldMatrices' multi attribute, and then read out the shape node from a corresponding plug in a 'outputShapes' multi plug. If this doesn't make sense, I can offer a fuller description... - Paul On Fri, Jun 12, 2009 at 3:20 PM, jasonosipa<[email protected]> wrote: > > 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 -~----------~----~----~----~------~----~------~--~---
