Im trying to get the area of individual faces on a polygon object using the
Maya Python API.
I'm using the 'getArea' method in a 'MItMeshPolygon' iterator.
It requires a pointer to a double variable to store the area value in. (so I
figured 'MScriptUtil' is also needed)
Although I don't get any errors, the 'getArea', just seems to be outputting 0.0
for all faces.
So here is a snippet of code.
pFaceIterator = OpenMaya.MItMeshPolygon(inputGeometryObject)
faceAreas = []
while not pFaceIterator.isDone():
faceArea = OpenMaya.MScriptUtil()
faceArea.createFromDouble(0.0) # also tried without this line
faceAreaPntr = faceArea.asDoublePtr()
pFaceIterator.getArea(faceAreaPntr) # this is what is not working
properly
faceAreas.append(faceArea.asDouble())
pFaceIterator.next()
Does anyone know why this is happening or know any fixes or alternate methods?
Thanks
Ethan
--
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 post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.