Command associates normal(x, y, z) with vertices on polygonal objects. When used with the query flag, it returns the normal associated with the specified components. However, when queried, the command returns all normals (all vtx-face combinations) on the vertex, regardless of whether they ar shared or not.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
allLocked (al) | bool | ![]() ![]() ![]() |
|
|
|||
deformable (deformable) | bool | ![]() ![]() ![]() |
|
DEFAULT true OBSOLETE flag. This flag will be removed in the next release.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
freezeNormal (fn) | bool | ![]() ![]() ![]() |
|
|
|||
normalX (x) | float | ![]() ![]() ![]() |
|
|
|||
normalXYZ (xyz) | float, float, float | ![]() ![]() ![]() |
|
|
|||
normalY (y) | float | ![]() ![]() ![]() |
|
|
|||
normalZ (z) | float | ![]() ![]() ![]() |
|
|
|||
relative (rel) | bool | ![]() ![]() ![]() |
|
|
|||
unFreezeNormal (ufn) | bool | ![]() ![]() ![]() |
|
|
Derived from mel command maya.cmds.polyNormalPerVertex
Example:
import pymel.core as pm
import maya.cmds as cmds
# To set the xyz values of normals of selected vertices:
pm.polyNormalPerVertex( xyz=(0.2, 0.3, 0.4) )
# To set just the "x" value of normal of selected vertices:
pm.polyNormalPerVertex( x=.37 )
# To add to the current value of the "y" normal value of selected vertices:
pm.polyNormalPerVertex( rel=True, y=.13 )
# To query the normal values on selected vertices - This returns all normals
# regardless of whether they are shared or not:
pm.polyNormalPerVertex( query=True, xyz=True )
# To query if the normals on the selected vertices are locked or not
pm.polyNormalPerVertex( query=True, freezeNormal=True )
# To query if all the normals on the selected vertices are locked or not
pm.polyNormalPerVertex( query=True, allLocked=True )
# More examples
pm.file( f=True, new=True )
pm.polyCube()
pm.select( 'pCube1.vtxFace[2][1]', r=True )
pm.polyNormalPerVertex( query=True, freezeNormal=True )
0
# Now, lock the normal of a VertexFace on the cube
pm.select('pCube1.vtxFace[2][1]', r=True )
pm.polyNormalPerVertex( xyz=(0.7071, 0, 0.7071) )
# Query if the normal is locked for this vertexFace
pm.polyNormalPerVertex( query=True, freezeNormal=True )
1
# Query if the normal is locked for all the normals on this vertex
# Should return 0, because there are some other normals on
# this vertex that are not locked.
pm.select('pCube1.vtx[2]', r=True)
pm.polyNormalPerVertex( query=True, allLocked=True )
0