fixing polygon normals

46 views
Skip to first unread message

s...@weacceptyou.com

unread,
Nov 21, 2015, 12:17:08 PM11/21/15
to Python Programming for Autodesk Maya
Hello,

im trying to write a bit of python code which will do a check at any given time that all the polygon surfaces in my scene have normals pointing outwards.

obviously with flat surfaces there is no way for python to know which direction is correct for the normals to be. But im talking about the concave surfaces or closed surfaces. I want the normals to always be facing outwards.

is there a way through python to check this automatically and reverse normals, without having to check each surface manually.

thanks,
Sam

Demetrius

unread,
Nov 21, 2015, 12:28:26 PM11/21/15
to python_in...@googlegroups.com
Just a thought- could you reconstruct the normal by using the UV directions on the polys?

Demetrius Leal
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/953eb212-9c1b-481c-ba40-4f71c8cec996%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Boon

unread,
Dec 17, 2015, 8:17:16 PM12/17/15
to Python Programming for Autodesk Maya, s...@weacceptyou.com
What about the command polyNormal(normalMode=2) (or in the Maya GUI, Normals > Conform)? If your problem is just a few faces in each mesh, that would probably take care of it for you.

If your problem is entire meshes being inside out and you're looking for an algorithm to find out which ones are inside out, I'd look at computePolysetVolume.mel (included with Maya). If you do a calculation like that on a mesh, and the result comes out negative, then the mesh is inside-out.

I hope that's useful.

Boon
Reply all
Reply to author
Forward
0 new messages