移動先: 概要 戻り値 Python 例.

概要

nParticle( selectionItem )

注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。

nParticle は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。

nParticle コマンドは、ワールド空間ポイントのリストから、新しい nParticle オブジェクトを作成します。nParticle オブジェクトが作成された場合、このコマンドは新しいパーティクル シェイプの名前と、これにコネクトされたパーティクル オブジェクトのディペンデンシー ノードを返します。オブジェクトを照会すると、照会結果を返します。パーティクル ID かパーティクル配列内でのパーティクルの順位を使用すると、パーティクル単位のアトリビュートを照会できます。 オブジェクトを編集した場合は何も返されません。

戻り値

string作成された nParticle オブジェクトの名前。

戻り値の型は照会モードでは照会フラグが基になります。

Python 例

import maya.cmds as cmds

# Creates a particle object with four particles
cmds.nParticle( p=[(0, 0, 0), (3, 5, 6), (5, 6, 7), (9, 9, 9)] )

# Returns the age of the particle with id 2 in object particle1
cmds.nParticle( 'particle1', q=True, attribute='age', id=2 )

# Returns the velocity of the 3rd particle in the currently selected
# particle object
cmds.nParticle( attribute='velocity', q=True, order=3  )

# Edits the velocity of the 7th particle in the currently selected
# particle object to be 0.0, 1.0, 0.0
cmds.nParticle( e=True, attribute='velocity', order=3, vectorValue=(0.0, 1.0, 0.0) )

# Edits the mass of the particle in "particle1" with id 3 to be 0.7
cmds.nParticle( 'nParticle1', e=True, attribute='mass', id=3, fv=0.7 )