ジャンプ先: 概要. 戻り値. 関連. フラグ. Python 例.
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])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
geometryAttrInfo は、取り消し可能、照会不可能、および編集不可能です。
このコマンドは、アトリビュート内のジオメトリに関する情報を提供します。したがって、このコマンドはジオメトリを含むアトリビュートにのみ作用します。頂点の数、バウンディング ボックス、存在する componentTags など、さまざまなタイプの情報をリクエストできます。
リクエストは、ジオメトリのサブセットに対して行うことができます。ジオメトリのサブセットは、特定のグループ ID または componentTag エクスプレッションによって限定されます。たとえば、componentTag エクスプレッションを使用している場合は、リクエストされたインデックスを使用して、このエクスプレッションで定義されたサブセットが照合されます。
| Any | アトリビュート内のジオメトリに関する情報です。返される値の数および型は、情報リクエストによって決まります。 |
attributeQuery, getAttr, listAttr
boundingBox, castToEdges, castToFaces, castToVerts, componentTagCategory, componentTagExpression, componentTagHash, componentTagHistory, componentTagHistoryHash, componentTagNames, components, deformerChain, elementCount, groupId, matrix, nodeChain, originalGeometry, outputPlugChain, plugChain, pointCount, pointIndices, points, subsetState
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。
|
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]'] #