ジャンプ先: 概要. 戻り値. 関連. フラグ. Python 例.
collision(
[objects]
, [friction=float], [name=string], [resilience=float])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
collision は、取り消し可能、照会可能、および編集可能です。
collision コマンドは、パーティクルをジオメトリと衝突させます。また、衝突のサーフェス プロパティ(摩擦と弾性)の値を指定することもできます。この値は、ジオメトリ オブジェクトの geoConnector ノードに格納されます。Maya の以前のバージョンとは異なり、分離した「衝突ノード」はありません。ソフト オブジェクトがセレクション リスト内にある場合、collision コマンドは、これをコライダにすると仮定します。ソフト オブジェクトを何かと衝突させるには、connectDynamic -c を使用します。衝突(Collision)メニュー オプションは最重要オブジェクト規則を使用してこれを分類し、必要なコマンドを発行します。作成時、このコマンドは、パーティクル衝突用に設定したジオメトリ名の文字配列を返します。
このコマンドを使用して情報を照会すると、返される可能性のあるタイプが複数あります。これには次のようなケースがあります。
ここで、「:」の後の数字はマルチインデックスです。
string[] | パーティクル衝突用に設定したジオメトリ名。 |
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
---|---|---|---|---|
friction(f)
|
float
|
![]() ![]() |
||
|
||||
name(n)
|
string
|
|||
|
||||
resilience(r)
|
float
|
![]() ![]() |
||
|
![]() |
![]() |
![]() |
![]() |
import maya.cmds as cmds cmds.collision( 'nurbsSphere1', 'particle1', r=.75, f=.1 ) # Causes particles of particle1 to collide with nurbsSphere1, # and sets a resilience value of 0.75 and a friction value of 0.1 # for the surface. cmds.collision( 'nurbsSphere1', q=True, f=1 ) # Returns the friction value stored in the geoConnector for nurbsSphere1. cmds.collision( 'particleShape1', 'nurbsSphere1', q=True, f=1 ) # Returns the friction value that particleShape1 is using for collisions # against nurbsSphere1. This may be the same as the friction stored in # nurbsSphere1's geoConnector. Or, if the user broke that connection, # then it is whatever value is in the particleShape1's collisionFriction # attribute that is used for collision with nurbsSphere1. cmds.collision( 'nurbsSphere1', 'particleShape1', q=True ) # Returns whether or not particleShape1 is checking for collisions # against nurbsSphere1. cmds.collision( 'particleShape1', q=True ) # Returns all of the geometries that particleShape1 is colliding with.