移動先: 概要 戻り値 キーワード. フラグ. Python 例.

概要

setFluidAttr([addValue=boolean], [attribute=string], [clear=boolean], [floatRandom=float], [floatValue=float], [lowerFace=boolean], [reset=boolean], [vectorRandom=[float, float, float]], [vectorValue=[float, float, float]], [xIndex=int], [xvalue=boolean], [yIndex=int], [yvalue=boolean], [zIndex=int], [zvalue=boolean])

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

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

個々のグリッド セルまたはグリッドにあるすべてのセルに対し、密度や速度など、ビルトインの流体アトリビュートの値を設定します。

戻り値

なし

キーワード

fluid

フラグ

addValue, attribute, clear, floatRandom, floatValue, lowerFace, reset, vectorRandom, vectorValue, xIndex, xvalue, yIndex, yvalue, zIndex, zvalue
ロング ネーム(ショート ネーム) 引数型 プロパティ
attribute(at) string create
値を設定する流体アトリビュートを指定します。有効なアトリビュートは、速度(Velocity)、密度(Density)、燃料(Fuel)、カラー(Color)、減衰(Falloff)、温度(Temperature)です。
xvalue(x) boolean
-at/attribute フラグで指定したベクトル値アトリビュートの、1 番目のコンポーネントのみを設定します。
yvalue(y) boolean
-at/attribute フラグで指定したベクトル値アトリビュートの、2 番目のコンポーネントのみを設定します。
zvalue(z) boolean
-at/attribute フラグで指定したベクトル値アトリビュートの、3 番目のコンポーネントのみを設定します。
clear(cl) boolean
このアトリビュートを 0 に設定します。
reset(re) boolean
このアトリビュートをデフォルト値に設定します。
addValue(ad) boolean
指定した値をアトリビュートに追加します。
floatValue(fv) float
密度などのスカラー アトリビュートの場合は、この値を使用します。
vectorValue(vv) [float, float, float]
速度などのベクトル アトリビュートの場合は、この値を使用します。
floatRandom(fr) float
密度などのスカラー アトリビュートの場合は、ランダム値を +-VALUE で使用します。fv を指定している場合は、基数としてランダム値と統合します。fv フラグを指定していない場合、基数は 0 と仮定します。
vectorRandom(vr) [float, float, float]
速度などのベクトル アトリビュートの場合は、ランダム値を +-VALUE で使用します。vv を指定している場合は、基数としてこのランダム値と統合します。w フラグを指定していない場合、基数は 0,0,0 と仮定します。
xIndex(xi) int create
この X インデックスを持つセルの値のみを返します。
yIndex(yi) int create
この Y インデックスを持つセルの値のみを返します。
zIndex(zi) int create
この Z インデックスを持つセルの値のみを返します。
lowerFace(lf) boolean create
-at velocity のみで有効です。速度値は各ボクセルの中心ではなく端に格納されるので、ボクセル ベースのインデックスで速度を設定すると、隣接するボクセルが必然的に影響を受けます。このフラグは、ボクセルの全 6 面ではなく、左下 3 面のみの速度成分を設定する場合に使用します。

: コマンドの作成モードで使用可能なフラグ : コマンドの編集モードで使用可能なフラグ
: コマンドの照会モードで使用可能なフラグ : タプルまたはリストとして渡された複数の引数を持てるフラグ

Python 例

import maya.cmds as cmds

# set density for entire fluid
cmds.setFluidAttr( at='density', fv=1.0 )
# add 3.5 to the density at the cell x=1, y=2, z=3
cmds.setFluidAttr( at='density', ad=True, fv-3.5, xi=1, yi=2, zi=3 )
# clear the density for the whole fluid
cmds.setFluidAttr( at='density', cl=True )
# reset the velocity at the cell x=1, y=2, z=3
cmds.setFluidAttr( at='velocity', re=True, xi=1, yi=2, zi=3 )
# set the velocity at the centers of the voxels on plane y=5
# to approximately (-1, 0, 0)
cmds.setFluidAttr( at='velocity', vv=(-1, 0, 0), yi=5 )
# set the Z-component of the velocity at the bottom of cell [0, 0, 0]
# to exactly 1.3
cmds.setFluidAttr( at='velocity', z=True, xi=0, yi=0, zi=0, fv=1.3 )
# set the X-component of the velocity at the right of cell [5, 3, 2]
# (which is also the left of cell [6, 3, 2]) to exactly 4.8
cmds.setFluidAttr( at='velocity', x=True, xi=5, yi=3, zi=2, fv=4.8 )
# set the density to a random value in the range 0.1 to 0.9
# the fv flag specfies the base value, and then we add a a
# random value in the range of -fr to +fr
cmds.setFluidAttr( at='density', fv=0.5, fr=0.4 )