MItMeshPolygon.getNormal() strange result?

Skip to first unread message

Rudi Hammad

Apr 27, 2021, 10:24:15 PMApr 27
to Python Programming for Autodesk Maya

I want to get the face normal of a polygon using the API. So tipically I get 3 vertices on a polygon, and to the cross vector, normalize, etc... but the MItMeshPolygon has a getNormal() method. So you give the id and an mvector to fill up and that is the normal polygon. Now this is what I don't get. Lets say you a one face plane and you rotate 90 degrees in X the vertices (not the transform). getNormal() returns the expected vector (0, 0, 1). However, if you rotate the transform 90 degrees  the result is (0, 1, 0) as if nothing happened.

I tried al the MSpace possible but they don't do anything as expected. So I am not sure of getNormal() is supposed to work.


Rudi Hammad

Apr 27, 2021, 10:47:47 PMApr 27
to Python Programming for Autodesk Maya
oh, never mind...the id is not the face id, it is the vertex id, that why the result where weird.
Isn't really anything as simple as passing a face and getting the normal? I know how to get eveything I need using vector operations but I thought that maybe there is a direct method hidden somewhere in the api.
Maybe not.

Rudi Hammad

Apr 28, 2021, 12:39:35 PMApr 28
to Python Programming for Autodesk Maya
aaarhhhgggg....again, never is a simple as using MFnMesh getPolygonNormal method on worldspace. You can delete this thread if you want to.

João Victor

Apr 28, 2021, 3:04:52 PMApr 28
No problem, Rudi! Feel free to post your doubts. Im working on a project with these functions, but just saw your thread now.


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
To view this discussion on the web visit
Reply all
Reply to author
0 new messages