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

Synopsis

polyEvaluate [-accurateEvaluation] [-activeShells] [-activeUVShells] [-area] [-boundingBox] [-boundingBox2d] [-boundingBoxComponent] [-boundingBoxComponent2d] [-displayStats] [-edge] [-edgeComponent] [-face] [-faceArea] [-faceComponent] [-format] [-shell] [-triangle] [-triangleComponent] [-uvArea] [-uvComponent] [-uvEdgePairs] [-uvFaceArea] [-uvSetName string] [-uvShell] [-uvShellIds] [-uvcoord] [-uvsInShell int] [-vertex] [-vertexComponent] [-worldArea] [-worldFaceArea] [poly poly...]

polyEvaluate is undoable, NOT queryable, and NOT editable.

Returns the required counts on the specified objects.
If no objects are specified in the command line, then the objects from the active list are used.

In MEL, the values are returned in the same order as the flags are set. Under Python, there is no concept of argument ordering, so the items are returned in a dictionary keyed by the name of the flag. In Python, if only one item is requested, then it will not be returned in a dictionary.
For user convenience, if no flag is set, then all values are echoed.

All flags (except -fmt/format) are in fact query-flags. For user convenience, the -q flag may be ommitted.

Some comments for non-formatted output :

Return value

Anya MEL array of values, a Python dictionary, or a string, depending on the format requested and the language called from.

Related

polyInfo

Flags

accurateEvaluation, activeShells, activeUVShells, area, boundingBox, boundingBox2d, boundingBoxComponent, boundingBoxComponent2d, displayStats, edge, edgeComponent, face, faceArea, faceComponent, format, shell, triangle, triangleComponent, uvArea, uvComponent, uvEdgePairs, uvFaceArea, uvSetName, uvShell, uvShellIds, uvcoord, uvsInShell, vertex, vertexComponent, worldArea, worldFaceArea
Long name (short name) Argument types Properties
-accurateEvaluation(-ae) create
used to get accurate results for the bounding box computation For objects with large vertex counts, accurate evaluation takes more time
-activeShells(-as) create
returns the indices of active shells as an array of int
-activeUVShells(-aus) create
returns the indices of active UV shells (for the current map if one is not specified) as an array of int
-area(-a) create
returns the surface area of the object's faces in local space as a float
-boundingBox(-b) create
returns the object's bounding box in 3d space as 6 floats in MEL: xmin xmax ymin ymax zmin zmax, or as a tuple of three pairs in Python: ((xmin,xmax), (ymin,ymax), (zmin,zmax))
-boundingBox2d(-b2) create
returns the object's uv bounding box (for the current map if one is not specified) in 2d space as 4 floats in MEL : xmin xmax ymin ymax, or as a tuple of three pairs in Python: ((xmin,xmax), (ymin,ymax), (zmin,zmax))
-boundingBoxComponent(-bc) create
returns the bounding box of selected components in 3d space as 6 floats in MEL : xmin xmax ymin ymax zmin zmax, or as a tuple of three pairs in Python: ((xmin,xmax), (ymin,ymax), (zmin,zmax))
-boundingBoxComponent2d(-bc2) create
returns the bounding box of selected/specified components uv coordinates in 2d space as 4 floats in MEL : xmin xmax ymin ymax, or as a tuple of two pairs in Python: ((xmin,xmax), (ymin,ymax))
-displayStats(-ds) create
toggles the display of poly statistics for the active View. All other flags are ignored if this flag is specified (Obsolete - refer to the headsUpDisplay command)
-edge(-e) create
returns the number of edges as an int
-edgeComponent(-ec) create
returns the object's number of selected edges as an int
-face(-f) create
returns the number of faces as an int
-faceArea(-fa) create
returns the surface area of selected/specified faces in local space as an array of float
-faceComponent(-fc) create
returns the object's number of selected faces as an int
-format(-fmt) create
used to display the results as an explicit sentence
-shell(-s) create
returns the number of shells (disconnected pieces) as an int
-triangle(-t) create
returns the number of triangles as an int
-triangleComponent(-tc) create
returns the number of triangles of selected components as an int
-uvArea(-uva) create
returns the UV area of the object's faces in 2d space as a float
-uvComponent(-uvc) create
returns the object's number of selected uv coordinates as an int
-uvEdgePairs(-uep) create
returns the pairs of UVs that are on the selected/specified edges
-uvFaceArea(-ufa) create
returns the UV area of selected/specified faces in 2d space as an array of float
-uvSetName(-uvs) string create
used when querying texture vertices to specify the uv set. If a uv set is not specified then the current map for the object will be used
-uvShell(-us) create
returns the number of UV shells (for the current map if one is not specified) as an int
-uvShellIds(-usi) create
returns the UV shell indices for selected/specified faces or UVs as an array of int (for the current map if one is not specified), one shell index per each face/UV.
-uvcoord(-uv) create
returns the number of uv coordinates (for the current map if one is not specified) as an int
-uvsInShell(-uis) int create
returns all UVs inside specified shell(for the current map if one is not specified), use activeUVShells to get shell indices for current selection, use uvShellIds to get shell indices for specified faces or UVs
-vertex(-v) create
returns the number of vertices as an int
-vertexComponent(-vc) create
returns the object's number of selected vertices as an int
-worldArea(-wa) create
returns the surface area of the object's faces in world space as a float
-worldFaceArea(-wfa) create
returns the surface area of selected/specified faces in world space as an array of float

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

polyPlane -n plg -sx 4 -sy 4 -w 5 -h 5;
select plg.f[2] plg.f[4];

// query the number of faces
polyEvaluate -f;
// Result: 16

// query the number of triangles
polyEvaluate -t;
// Result: 32

// query the number of selected faces
polyEvaluate -faceComponent;
// Result: 2

// query the number of vertices and faces
polyEvaluate -v -f;
// Result: 25 16

// formatted query of the number of vertices and faces
polyEvaluate -v -f -fmt;
// Result: vertex=25 face=16

// query all
polyEvaluate;
// Result: 25 40 16 25 32 1 1 0 0 2 0 0

//formatted query of all information
polyEvaluate -fmt;
// Result: vertex=25 edge=40 face=16 uvcoord=25 triangle=32 shell=1 uvShell=1
//    vertexComponent=0 edgeComponent=0 faceComponent=2 uvComponent=0
//    triangleComponent=4 activeShells= 0 activeUVShells= 0 uvShellIds= 0 0
//    faceArea= 1.5625 1.5625 worldFaceArea= 1.5625 1.5625 uvFaceArea= 0.0625 0.0625
//    boundingBox= X[-2.50,2.50] Y[-0.00,0.00] Z[-2.50,2.50]
//    boundingBoxComponent= X[-2.50,1.25] Y[-0.00,0.00] Z[0.00,2.50]
//    boundingBox2d= U[0.00,1.00] V[0.00,1.00]
//    boundingBoxComponent2d= U[0.00,0.75] V[0.00,0.50]
//    area=25.00 worldArea=25.00 uvArea=1.00

// accurate bounding box evaluation
polyCylinder -r 1 -h 2 -sx 20 -sy 1 -sz 1 -ax 0 1 0 -cuv 1 -ch 1;
 // Result: pCylinder1 polyCylinder1 //
rotate -r -os 38.340875 0 0 ;
rotate -r -os 0 0 -36.177835 ;

polyEvaluate -b;
 // Result: -1.397482 1.397482 -1.716432 1.716432 -1.651247 1.651247 //
polyEvaluate -b -ae;
 // Result: -1.397482 1.397482 -1.407107 1.407107 -1.359833 1.359833 //

// Local and World Space Area
polyCube -w 1 -h 1 -d 1 -sx 1 -sy 1 -sz 1 -ax 0 0 1 -tx 1 -ch 1;
setAttr "pCube1.scaleY" 2;
polyEvaluate -a;
// Result: 6
polyEvaluate -wa;
// Result: 10

// UV Shell information
polySphere -sx 20 -sy 20;
polyAutoProjection;
hilite;
select -r pSphere1.f[282] pSphere1.f[189:192];

// number of UV shells
polyEvaluate -uvShell
// Result: 6

// active UV Shells
polyEvaluate -activeUVShells
// Result: 1 4 5

// UV shell IDs for selected faces
polyEvaluate -uvShellIds
// Result: 1 1 1 4 5

// UV edge pairs for selected edges
polyEvaluate -uvEdgePairs pSphere1.e[642];
// Result: pSphereShape1.map[67] pSphereShape1.map[74] pSphereShape1.map[307] pSphereShape1.map[300]