Go to: Synopsis. Return value. Keywords. Related. Flags. Python examples.
polyNormalPerVertex([allLocked=boolean], [deformable=boolean], [freezeNormal=boolean], [normalX=float], [normalXYZ=[float, float, float]], [normalY=float], [normalZ=float], [relative=boolean], [unFreezeNormal=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
polyNormalPerVertex is undoable, queryable, and editable.
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 are shared or not.
boolean | Success or Failure. |
In query mode, return type is based on queried flag.
poly, userNormals, polyNormals, setNormal, vertexNormal, vertex
polyAverageNormal, polyNormal, polySetToFaceNormal, polySoftEdge
allLocked, deformable, freezeNormal, normalX, normalXYZ, normalY, normalZ, relative, unFreezeNormal
Long name (short name) |
Argument types |
Properties |
|
allLocked(al)
|
boolean
|
|
|
Queries if all normals on the selected vertices are locked (frozen) or not
|
|
deformable(deformable)
|
boolean
|
|
|
DEFAULT true
OBSOLETE flag. This flag will be removed in the next release.
|
|
freezeNormal(fn)
|
boolean
|
|
|
Specifies that the normal values be frozen (locked) at the current value.
|
|
normalX(x)
|
float
|
|
|
Specifies the x value normal
|
|
normalXYZ(xyz)
|
[float, float, float]
|
|
|
Specifies the xyz values normal
If this flag is used singly, the specified normal xyz values are
used for all selected components.
If the flag is used multiple times, the number of uses must match
the number of selected components, and each use specifies
the normal of one component.
|
|
normalY(y)
|
float
|
|
|
Specifies the y value normal
|
|
normalZ(z)
|
float
|
|
|
Specifies the z value normal
|
|
relative(rel)
|
boolean
|
|
|
When used, the normal values specified are added relative to the current value.
|
|
unFreezeNormal(ufn)
|
boolean
|
|
|
Specifies that the normal values that were frozen at the current value be
un-frozen (un-locked).
|
|
Flag can appear in Create mode of command
|
Flag can appear in Edit mode of command
|
Flag can appear in Query mode of command
|
Flag can have multiple arguments, passed either as a tuple or a list.
|
import maya.cmds as cmds
# To set the xyz values of normals of selected vertices:
cmds.polyNormalPerVertex( xyz=(0.2, 0.3, 0.4) )
# To set just the "x" value of normal of selected vertices:
cmds.polyNormalPerVertex( x=.37 )
# To add to the current value of the "y" normal value of selected vertices:
cmds.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:
cmds.polyNormalPerVertex( query=True, xyz=True )
# To query if the normals on the selected vertices are locked or not
cmds.polyNormalPerVertex( query=True, freezeNormal=True )
# To query if all the normals on the selected vertices are locked or not
cmds.polyNormalPerVertex( query=True, allLocked=True )
# More examples
cmds.file( f=True, new=True )
cmds.polyCube()
cmds.select( 'pCube1.vtxFace[2][1]', r=True )
cmds.polyNormalPerVertex( query=True, freezeNormal=True )
# Result: 0 #
# Now, lock the normal of a VertexFace on the cube
cmds.select('pCube1.vtxFace[2][1]', r=True )
cmds.polyNormalPerVertex( xyz=(0.7071, 0, 0.7071) )
# Query if the normal is locked for this vertexFace
cmds.polyNormalPerVertex( query=True, freezeNormal=True )
# Result: 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.
cmds.select('pCube1.vtx[2]', r=True)
cmds.polyNormalPerVertex( query=True, allLocked=True )
# Result: 0 #