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

Synopsis

geometryAttrInfo [-boundingBox] [-castToEdges] [-castToFaces] [-castToVerts] [-componentTagCategory] [-componentTagExpression string] [-componentTagHash] [-componentTagHistory] [-componentTagHistoryHash] [-componentTagNames] [-components] [-deformerChain] [-elementCount] [-groupId int] [-matrix] [-nodeChain] [-originalGeometry] [-outputPlugChain] [-plugChain] [-pointCount] [-pointIndices] [-points] [-subsetState] attribute

geometryAttrInfo is undoable, NOT queryable, and NOT editable.

This command provides information about the geometry in an attribute. This command therefore only works on attributes that contain geometry. A variety of types of information can be requested, like the number of verts, the boundingbox, which componentTags exist, etc.

The requests can be made on a subset of the geometry, either limited by a specific groupId or by a componentTag expression. For example, when a componentTag expression is used, the requested indices will be the indices that match the subset as defined by that expression.

Return value

AnyInformation about the geometry in the attribute. The number and type of values returned depends on the information request.

Related

attributeQuery, getAttr, listAttr

Flags

boundingBox, castToEdges, castToFaces, castToVerts, componentTagCategory, componentTagExpression, componentTagHash, componentTagHistory, componentTagHistoryHash, componentTagNames, components, deformerChain, elementCount, groupId, matrix, nodeChain, originalGeometry, outputPlugChain, plugChain, pointCount, pointIndices, points, subsetState
Long name (short name) Argument types Properties
-boundingBox(-bb) create
Returns the bounding box of the geometry
-castToEdges(-cte) create
Ensures the componentTag expression will be resolved to edge components
-castToFaces(-ctf) create
Ensures the componentTag expression will be resolved to face components
-castToVerts(-ctv) create
Ensures the componentTag expression will be resolved to vert components
-componentTagCategory(-ccy) create
This flag will return the component tag category of the resulting components. Verts are "v", edges are "e", faces are "f". In case the the category can not be determined "unknown" is returned
-componentTagExpression(-cex) string create
Specifies the componentTagExpression we want to query. When specified all answers to the information requests will be limited to the subset of the geometry as is contained in the combination of these componentTags
-componentTagHash(-hsh) create
This flag will return a unique hash value for the state of all the componentTags contained in the geometry. If a hash is different from before it means that something has changed, either tags have been added/removed/renamed and/or their component contents have been altered.
-componentTagHistory(-cth) create
This flag will return a description of the componentTags and the nodes in the chain where they were added to the geometry.
-componentTagHistoryHash(-chh) create
This flag will return a unique hash value for the componentTag history of the geometry in the plug. If a hash is different from before it means that something has changed, either different nodes have created the tags or the contents of the tags have been altered.
-componentTagNames(-cnm) create
Returns the names of the componentTags on the geometry
-components(-cmp) create
Returns the components of the geometry
-deformerChain(-dch) create
This flag will return the list of deformer nodes through which the geometry passes to the specified plug
-elementCount(-ec) create
Returns the element count of the components
-groupId(-gid) int create
Specifies the groupId we want to query. When specified all answers to the information requests will be limited to the subset of the geometry as is contained in this groupId
-matrix(-mtx) create
Returns the matrix associated with the geometry
-nodeChain(-nch) create
This flag will return the list of nodes through which the geometry passes to the specified plug
-originalGeometry(-og) create
This flag will return the name of a plug on a node upstream (likely at the front end) that is the best candidate to be used as the originalGeometry. This can return an empty plug when none exists.
-outputPlugChain(-och) create
This flag will return the chain of plugs upstream of the specified plug (including only output plugs)
-plugChain(-pch) create
This flag will return the chain of plugs upstream of the specified plug (including both input and output plugs)
-pointCount(-pc) create
Returns the point count of the geometry
-pointIndices(-pi) create
Returns the indices of the geometry
-points(-pnt) create
Returns a list of points of the geometry
-subsetState(-sbs) create
Returns the state of the specified subset -1 means the subset was invalid 0 means the subset contains none of the points of the geometry 1 means the subset contains some (but not all) of the points of the geometry 2 means the subset contains all the points of the geometry

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

    polyCylinder -r 1 -h 6 -sx 4 -sy 5 -sz 1 -name myGeo;
    select myGeo.vtx[12:23] myGeo.vtx[25];
    string $clusterList[]=`cluster`;
    move -absolute 1.0 0 0 $clusterList[1];

    // Find the groupId for the cluster node to test our queries
    int $gid = `getAttr ($clusterList[0] + ".input[0].groupId")`;

    // Get the number of points
    int $n0 = `geometryAttrInfo -pc myGeo.outMesh`;
    int $n1 = `geometryAttrInfo -pc -gid $gid myGeo.outMesh`;

    print ("Deforming " + $n1 + " out of " + $n0 + " points\n");
    // Deforming 13 out of 26 points

    // Get the indices that are being deformed
    geometryAttrInfo -pi -gid $gid myGeo.outMesh;
    // Result: 12 13 14 15 16 17 18 19 20 21 22 23 25 //

    // Get the components that are being deformed
    geometryAttrInfo -cmp -gid $gid myGeo.outMesh;
    // Result: vtx[12:23] vtx[25] //

    // Get the bounding box of the total geometry
    geometryAttrInfo -bb myGeo.outMesh;
    // Result: -1 2 -3 3 -1 1 //

    // Get the bounding box of what is being deformed
    geometryAttrInfo -bb -gid $gid myGeo.outMesh;
    // Result: 0 2 0.6 3 -1 1 //

    // Get the node chain leading up to the cluster
    geometryAttrInfo -nch cluster1.outputGeometry[0];
    // Result: polyCylinder1 myGeoShapeOrig groupParts2 tweak1 cluster1GroupParts cluster1 //

    // Get the deformer chain leading up to the cluster
    geometryAttrInfo -dch cluster1.outputGeometry[0];
    // Result: tweak1 cluster1 //

    // Get the plug chain leading up to the cluster
    geometryAttrInfo -pch cluster1.outputGeometry[0];
    // Result: polyCylinder1.output myGeoShapeOrig.inMesh myGeoShapeOrig.worldMesh[0] groupParts2.inputGeometry groupParts2.outputGeometry tweak1.input[0].inputGeometry tweak1.outputGeometry[0] cluster1GroupParts.inputGeometry cluster1GroupParts.outputGeometry cluster1.input[0].inputGeometry cluster1.outputGeometry[0] //

    // Get the output plug chain leading up to the cluster
    geometryAttrInfo -och cluster1.outputGeometry[0];
    // Result: polyCylinder1.output myGeoShapeOrig.worldMesh[0] groupParts2.outputGeometry tweak1.outputGeometry[0] cluster1GroupParts.outputGeometry cluster1.outputGeometry[0] //