ジャンプ先: 概要. 戻り値. 関連. フラグ. Python 例.
getParticleAttr(
selectionItem
, [array=boolean], [attribute=string], [object=string])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
getParticleAttr は、取り消し可能、照会不可能、および編集不可能です。
このアクションは、パーティクル オブジェクトまたはコンポーネントの指定したパーティクル単位のアトリビュートに対して、値の配列または平均値と最大オフセットを返します。パーティクル コンポーネントがコマンド ラインで指定されている場合、そのコンポーネントの値だけを返します。オブジェクト名が指定されている場合、そのオブジェクトにあるすべてのパーティクルの値を返します。オブジェクト名は渡されないが、パーティクル オブジェクトまたはコンポーネントが選択されている場合、選択したものの値を返します。コンポーネントをリストする場合、すべて同一のパーティクル オブジェクトのコンポーネントである必要があります。最初のオブジェクト以外のオブジェクトはすべて無視されます。同様に複数のオブジェクトをリスト表示すると、最初のオブジェクトの値だけを返します。
| float[] | コマンドの結果 |
| ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
|---|---|---|---|---|
array(a)
|
boolean
|
|
||
|
||||
attribute(at)
|
string
|
|
||
|
||||
object(o)
|
string
|
|
||
|
||||
import maya.cmds as cmds cmds.getParticleAttr( 'particle1', at='velocity' ) # This will return the average velocity for the entire particle # object as well as the maximum offset from the average. cmds.getParticleAttr( 'particleShape1.pt[0:7]', 'particleShape1.pt[11]', at='velocity' ) # This will return the average velocity for particles 0-7 and 11 # as well as the maximum offset from the average. cmds.getParticleAttr( 'particleShape1.pt[0:7]', 'particleShape1.pt[11]', at='position', array=1 ) # This will return an array of 27 floats containing the position # values for the nine specified particles.