Typo at the start: You can get vertexFace normal directions from the polyNormalPerVertex command.
On Friday, January 25, 2013 2:26:39 PM UTC-8, Jesse Capper wrote: > You can vertexFace normals from the polyNormalPerVertex command. > > So something like: > > # Get the face vertices from the face > vtxfaces = cmds.polyListComponentConversion(my_poly_face, ff=True, tvf=True) > # Get a flattened list of the normals (the length of this list is: number of > vertexFaces * 3[for the x,y,z coord of each normal]) > flatnormals = cmds.polyNormalPerVertex(vtxfaces, q=True, xyz=True) > # Which you can group into x,y,z 3-tuples if you want: > normals = [] > for i in range(0, len(flatnormals), 3): > normals.append(flatnormals[i:i+3]) > > There's a slicker way of splitting a list into n-sized chunks, but it's not > as obvious/easy to figure out at first glance: > normals = zip(*[iter(flatnormals)]*3) > > On Friday, January 25, 2013 10:47:34 AM UTC-8, JR wrote: > > Hey all, > > > > Been learning a lot from this group but there is one problem that I can't > > seem to figure out. I'm trying to calculate the angle of a selected face > > based on the normal but I have no idea how to get that information. Nothing > > in the python command field seems to help. Any ideas? > > > > Thanks! > > > > J -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected].
