Saturday, April 10, 2010

Maya Python - Getting Points & Normals from MItGeometry all at once

From Adam Mechtley in Maya-Python mailing list:

Yes—it stores the result in the object you pass as a parameter, since it is passed by reference. As per my example:

meshIter0 = OpenMaya.MItGeometry(dag1)

points = OpenMaya.MPointArray()

meshIter0.allPositions(points, ObjectSpace)

# all the points are now stored in the points object

normals = OpenMaya.MVectorArray()

meshIter1.getNormals(normals, ObjectSpace)

# all the normals are now stored in the normals object

No comments: