ジャンプ先: 概要. 戻り値. 関連. フラグ. Python 例.

概要

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

注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。

polyEvaluate は、取り消し可能、照会不可能、および編集不可能です。

指定したオブジェクトで必要なカウントを返します。
コマンド ラインでオブジェクトを指定しない場合は、アクティブ リストのオブジェクトを使用します。

MEL では、値はフラグを設定したときと同じ順序で返されます。Python には引数の順序という概念はないため、項目はキー設定された辞書にフラグ名の順で戻されます。Python では、要求された項目が 1 つだけの場合、辞書には返されません。
使いやすくするために、フラグを設定しなければ、すべての値がエコーされます。

-fmt/format を除くすべてのフラグは照会フラグです。使いやすくするため、-q フラグは省略できます。

フォーマットしない出力の注意事項は以下のとおりです。

戻り値

Any要求されたフォーマット、およびコール元の言語に応じて、値の MEL 配列、Python 辞書、または文字列。

関連

polyInfo

フラグ

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
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
accurateEvaluation(ae) boolean create
バウンディング ボックスの計算で正確な結果を出すために使用します。頂点の数が多いオブジェクトでは、正確な評価に時間がかかります。
activeShells(activeShells) boolean create
アクティブなシェルのインデックスを整数の配列で返します。
activeUVShells(aus) boolean create
アクティブな UV シェル(指定されていない場合は現在のマップ)のインデックスを整数の配列で返します。
area(a) boolean create
ローカル空間にあるオブジェクトのフェースのサーフェス領域を float で返します。
boundingBox(b) boolean create
3D 空間のオブジェクトのバウンディング ボックスを、MEL では 6 つの float (xmin xmax ymin ymax zmin zmax)として、Python では 3 組のタプル[((xmin,xmax),(ymin,ymax),(zmin,zmax))]として返します。
boundingBox2d(b2) boolean create
2D 空間の(指定されていない場合は現在のマップに対する)オブジェクトの UV バウンディング ボックスを、MEL では 4 つの float (xmin xmax ymin ymax)として、Python では 3 組のタプル[((xmin,xmax),(ymin,ymax),(zmin,zmax))]として返します。
boundingBoxComponent(bc) boolean create
3D 空間で選択したコンポーネントのバウンディング ボックスを、MEL では 6 つの float (xmin xmax ymin ymax zmin zmax)として、Python では 3 組のタプル[((xmin,xmax),(ymin,ymax),(zmin,zmax))]として返します。
boundingBoxComponent2d(bc2) boolean create
2D 空間で選択/指定したコンポーネントの UV 座標のバウンディング ボックスを、MEL では 4 つの float (xmin xmax ymin ymax)として、Python では 2 組のタプル ((xmin,xmax),(ymin,ymax)) として返します。
displayStats(ds) boolean create
アクティブなビューのポリゴン統計の表示/非表示を切り替えます。このフラグを指定すると、その他すべてのフラグは無視されます(サポートしていません。headsUpDisplay コマンドを参照してください)。
edge(e) boolean create
エッジの数を整数で返します。
edgeComponent(ec) boolean create
選択したエッジのオブジェクトの数を整数で返します。
face(f) boolean create
フェースの数を整数で返します。
faceArea(fa) boolean create
ローカル空間で選択/指定した面のサーフェス領域を float の配列で返します。
faceComponent(fc) boolean create
選択したフェースのオブジェクトの数を整数で返します。
format(fmt) boolean create
結果を明示的な文で表示するために使用します。
shell(s) boolean create
シェル(切断されている断片)の数を整数で返します。
triangle(t) boolean create
三角形の数を整数で返します。
triangleComponent(tc) boolean create
選択したコンポーネントの三角形の数を整数で返します。
uvArea(uva) boolean create
2D 空間にあるオブジェクトの面の UV 領域を float で返します。
uvComponent(uvc) boolean create
選択した UV 座標のオブジェクトの数を整数で返します。
uvEdgePairs(uep) boolean create
選択/指定したエッジ上にある UV のペアを返します。
uvFaceArea(ufa) boolean create
2D 空間で選択/指定した面の UV 領域を float の配列で返します。
uvSetName(uvs) string create
UV セットを指定するためにテクスチャ頂点を照会するときに使用します。UV セットが指定されていない場合は、オブジェクトの現在のマップが使用されます。
uvShell(us) boolean create
UV シェルの数(指定されていない場合は現在のマップ)を整数で返します。
uvShellIds(usi) boolean create
選択/指定した面または UV のUV シェルのインデックスを整数の配列で返します(指定されていない場合は現在のマップ)。それぞれの面/UV に対して 1 つのシェル インデックスを返します。
uvcoord(uv) boolean create
UV 座標の数(指定されていない場合は現在のマップ)が整数で返されます。
uvsInShell(uis) int create
指定したシェル内のすべての UV を返します(指定されていない場合は現在のマップ)。現在の選択に対するシェル インデックスを取得する場合は activeUVShells を使用し、指定した面または UV に対するシェル インデックスを取得する場合は uvShellIds を使用します。
vertex(v) boolean create
頂点の数を整数で返します。
vertexComponent(vc) boolean create
選択した頂点のオブジェクトの数を整数で返します。
worldArea(wa) boolean create
ワールド空間にあるオブジェクトのフェースのサーフェス領域を float で返します。
worldFaceArea(wfa) boolean create
ワールド空間で選択/指定した面のサーフェス領域を float の配列で返します。

フラグはコマンドの作成モードで表示できます フラグはコマンドの編集モードで表示できます
フラグはコマンドの照会モードで表示できます フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。

Python 例

import maya.cmds as cmds

cmds.polyPlane( n='plg', sx=4, sy=4, w=5, h=5 )
cmds.select( 'plg.f[2]', 'plg.f[4]' )

# query the number of faces
cmds.polyEvaluate( f=True )
# Result: 16

# query the number of triangles
cmds.polyEvaluate( t=True )
# Result: 32

# query the number of selected faces
cmds.polyEvaluate( faceComponent=True )
# Result: 2

# query the number of vertices and faces
cmds.polyEvaluate( v=True, f=True )
# Result: {'vertex': 25, 'face': 16}

# formatted query of the number of vertices and faces
cmds.polyEvaluate( v=True, f=True, fmt=True )
# Result: "face=16 vertex=25"

# query all
cmds.polyEvaluate()
# Result: {'edge': 40, 'edgeComponent': 0, 'face': 16, 'faceComponent': 2, 'shell': 1, 'triangle': 32, 'triangleComponent': 0, 'uvComponent': 0, 'uvShell': 1, 'uvcoord': 25, 'vertex': 25,'vertexComponent': 0}

#formatted query of all information
cmds.polyEvaluate( fmt=True )
# 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
cmds.polyCylinder( r=1, h=2, sx=20, sy=1, sz=1, ax=(0, 1, 0), tx=1, ch=1 )
# Result: pCylinder1 polyCylinder1 #
cmds.rotate( 38.340875, 0, 0, r=True, os=True )
cmds.rotate( 0, 0, -36.177835, r=True, os=True )

cmds.polyEvaluate( b=True )
# Result: ((-1.3974823703620598, 1.39748217791327), (-1.7164316223605844, -1.7164316223605844), (-1.6512467204212007, 1.6512465272260637)) #
cmds.polyEvaluate( b=True, ae=True )
# Result: ((-1.3974823951721191, 1.39748215675354), (-1.4071073532104492, -1.4071073532104492), (-1.3598332405090332, 1.3598330020904541)) #

# Local and World Space Area
cmds.polyCube( w=1, h=1, d=1, sx=1, sy=1, sz=1, ax=(0, 0, 1), cuv=1, ch=1 )
cmds.setAttr( 'pCube1.scaleY', 2 )
cmds.polyEvaluate( a=True )
# Result: 6
cmds.polyEvaluate( wa=True )
# Result: 10

# UV Shell information
cmds.polySphere( sx=20, sy=20 )
cmds.polyAutoProjection()
cmds.hilite()
cmds.select( 'pSphere1.f[282]', 'pSphere1.f[189:192]', replace = True )

# number of UV shells
cmds.polyEvaluate( uvShell=True )
# Result: 6

# active UV Shells
cmds.polyEvaluate( activeUVShells=True )
# Result: [1, 4, 5]

# UV shell IDs for selected faces
cmds.polyEvaluate( uvShellIds=True )
# Result: [1, 1, 1, 4, 5]

# UV edge pairs for selected edges
cmds.polyEvaluate( 'pSphere1.e[642]', uvEdgePairs=True )
# Result: [u'pSphereShape1.map[67] pSphereShape1.map[74] pSphereShape1.map[307] pSphereShape1.map[300] ']