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