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

Synopsis

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

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

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) boolean create
Returns the bounding box of the geometry
castToEdges(cte) boolean create
Ensures the componentTag expression will be resolved to edge components
castToFaces(ctf) boolean create
Ensures the componentTag expression will be resolved to face components
castToVerts(ctv) boolean create
Ensures the componentTag expression will be resolved to vert components
componentTagCategory(ccy) boolean 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) boolean 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) boolean 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) boolean 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) boolean create
Returns the names of the componentTags on the geometry
components(cmp) boolean create
Returns the components of the geometry
deformerChain(dch) boolean create
This flag will return the list of deformer nodes through which the geometry passes to the specified plug
elementCount(ec) boolean 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) boolean create
Returns the matrix associated with the geometry
nodeChain(nch) boolean create
This flag will return the list of nodes through which the geometry passes to the specified plug
originalGeometry(og) boolean 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) boolean create
This flag will return the chain of plugs upstream of the specified plug (including only output plugs)
plugChain(pch) boolean create
This flag will return the chain of plugs upstream of the specified plug (including both input and output plugs)
pointCount(pc) boolean create
Returns the point count of the geometry
pointIndices(pi) boolean create
Returns the indices of the geometry
points(pnt) boolean create
Returns a list of points of the geometry
subsetState(sbs) boolean 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 have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

    import maya.cmds as cmds

    cmds.polyCylinder(n="myGeo", r=1, h=6, sx=4, sy=5, sz=1)[0]
    cmds.select(['myGeo.vtx[12:23]', 'myGeo.vtx[25]'])

    clusterNode, clusterHandle = cmds.cluster()
    cmds.move(1.0, 0, 0, clusterHandle, absolute=True)

    # Find the groupId for the cluster node to test our queries
    gid = cmds.getAttr('{0}.input[0].groupId'.format(clusterNode))

    # Get the number of points
    n0 = cmds.geometryAttrInfo('myGeo.outMesh', pc=True)
    n1 = cmds.geometryAttrInfo('myGeo.outMesh', gid=gid, pc=True)
    print "Deforming {0} out of {1} points".format(n1, n0)
    # Deforming 13 out of 26 points

    # Get the indices that are being deformed
    cmds.geometryAttrInfo('myGeo.outMesh', gid=gid, pi=True)
    # Result: [12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 25L] #

    # Get the components that are being deformed
    cmds.geometryAttrInfo('myGeo.outMesh', gid=gid, cmp=True)
    # Result: [u'vtx[12:23]', u'vtx[25]'] #

    # Get the bounding box of the total geometry
    cmds.geometryAttrInfo('myGeo.outMesh', bb=True)
    # Result: [-1.0, 2.0, -3.0, 3.0, -1.0, 1.0] #

    # Get the bounding box of what is being deformed
    cmds.geometryAttrInfo('myGeo.outMesh', gid=gid, bb=True)
    # Result: [0.0, 2.0, 0.6000001430511475, 3.0, -1.0, 1.0] #

    # Get the node chain leading up to the cluster]
    cmds.geometryAttrInfo('cluster1.outputGeometry[0]', nch=True)
    # Result: [u'polyCylinder1', u'myGeoShapeOrig', u'groupParts2', u'tweak1', u'cluster1GroupParts', u'cluster1'] #

    # Get the deformer chain leading up to the cluster
    cmds.geometryAttrInfo('cluster1.outputGeometry[0]', dch=True)
    # Result: [u'tweak1', u'cluster1'] #

    # Get the plug chain leading up to the cluster
    cmds.geometryAttrInfo('cluster1.outputGeometry[0]', pch=True)
    # Result: [u'polyCylinder1.output', u'myGeoShapeOrig.inMesh', u'myGeoShapeOrig.worldMesh[0]', u'groupParts2.inputGeometry', u'groupParts2.outputGeometry', u'tweak1.input[0].inputGeometry', u'tweak1.outputGeometry[0]', u'cluster1GroupParts.inputGeometry', u'cluster1GroupParts.outputGeometry', u'cluster1.input[0].inputGeometry', u'cluster1.outputGeometry[0]'] #

    # Get the output plug chain leading up to the cluster
    cmds.geometryAttrInfo('cluster1.outputGeometry[0]', och=True)
    # Result: [u'polyCylinder1.output', u'myGeoShapeOrig.worldMesh[0]', u'groupParts2.outputGeometry', u'tweak1.outputGeometry[0]', u'cluster1GroupParts.outputGeometry', u'cluster1.outputGeometry[0]'] #