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

Synopsis

polyAverageNormal [-allowZeroNormal boolean] [-distance float] [-postnormalize boolean] [-prenormalize boolean] [-replaceNormalXYZ float float float]

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 be used more than once in a command.

MEL examples


// To average normals when they are within 0.2 distance.
polyAverageNormal -distance 0.2;

// To average normals when they are within 0.2 distance.
// Normalize the normals before computing the average.
polyAverageNormal -distance 0.2 -prenormalize;

// 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.
polyAverageNormal -distance 0.2 -postnormalize;

// To average normals when they are within 0.2 distance. Do not
// allow zero normal and replace zero normal with (1 0 0).
polyAverageNormal -distance 0.2 -allowZeroNormal false -replaceNormalXYZ 1 0 0;