Go to: Synopsis. Return value. Keywords. Related. Flags. Python examples.

Synopsis

polyAverageNormal([allowZeroNormal=boolean], [distance=float], [postnormalize=boolean], [prenormalize=boolean], [replaceNormalXYZ=[float, float, float]])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

polyAverageNormal is undoable, NOT queryable, and NOT editable.

Set normals of vertices or vertex-faces to an average value when the vertices within a given threshold. First, it sorts out the containing edges, and set them to be soft, if it is possible, so to let the normals appear to be "merged". The remained components then are sorted into lumps where vertices in each lump are within the given threshold. For all vertices and vertex-faces, set their normals to the average normal in the lump. Selected vertices may or may not on the same object. If objects are selected, it is assumed that all vertices are selected. If edges or faces are selected, it is assumed that the related vertex-faces are selected.

Return value

stringof the node name.

Keywords

poly, userNormals, polyNormals, averageNormal, setNormal, vertexNormal

Related

polyNormal, polyNormalPerVertex, polySetToFaceNormal, polySoftEdge

Flags

allowZeroNormal, distance, postnormalize, prenormalize, replaceNormalXYZ
Long name (short name) Argument types Properties
allowZeroNormal(azn) boolean create
Specifies whether to allow zero normals to be created. By default it is false. If it is false, replaceNormal is needed.
distance(d) float create
Specifies the distance threshold. All vertices within the threshold are considered when computing an average normal. By default it is 0.0.
postnormalize(pon) boolean create
Specifies whether to normalize the resulting normals. By default it is true.
prenormalize(prn) boolean create
Specifies whether to normalize the normals before averaging. By default it is true.
replaceNormalXYZ(xyz) [float, float, float] create
If the allowZeroNormal is false, this value is used to replace the zero normals. By default it is (1, 0, 0).

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.

Python examples

import maya.cmds as cmds

# To average normals when they are within 0.2 distance.
cmds.polyAverageNormal( distance=0.2 )

# To average normals when they are within 0.2 distance.
# Normalize the normals before computing the average.
cmds.polyAverageNormal( distance=0.2, prenormalize=True )

# To averge normals when they are within 0.2 distance. Do not
# normalize the normals before computing the average (so to get weighted
# average). But do normalize the resulting normal.
cmds.polyAverageNormal( distance=0.2, postnormalize=True )

# To average normals when they are within 0.2 distance. Do not
# allow zero normal and replace zero normal with (1 0 0).
cmds.polyAverageNormal( distance=0.2, allowZeroNormal=False, replaceNormalXYZ=(1,0,0) )