ソフトボディ によって Nurbs、ポリゴンやラティスを柔らかい物体として表現できる。
ソフトボディを作ると対応する CV や頂点にパーティクルが作られ、そのパーティクルがフィールドなどによってアニメーションすると対応した CV や頂点が同じアニメーションをする。
ソフトボディを作るには soft コマンドを使用する。
シンプルな、風になびく旗を作ってみよう。
global proc makeFlag1()
{
string $pname[] = `nurbsPlane -width 12.0 -lengthRatio 0.5 -patchesU 12 -patchesV 12`;
rotate 0 90 0;
string $soname[] = `soft -goal 0.5 $pname[0]`;
string $tname[] = `turbulence -pos -6.0 0.0 0.0 -magnitude 100.0 -attenuation 0.0`;
connectDynamic -f $tname[0] $soname[0];
expression -o $tname[0] -s "phaseX = 10.0 * frame; phaseY = 10.0 * frame; phaseZ = 10.0 * frame;";
string $shname[] = `listRelatives -s $pname[0]`;
setAttr ($shname[0] + ".visibility") 0;
}
string $pname[] = `nurbsPlane -width 12.0 -lengthRatio 0.5 -patchesU 12 -patchesV 12`;
rotate 0 90 0;
string $soname[] = `soft -goal 0.5 $pname[0]`;
string $tname[] = `turbulence -pos -6.0 0.0 0.0 -magnitude 100.0 -attenuation 0.0`;
connectDynamic -f $tname[0] $soname[0];
expression -o $tname[0] -s "phaseX = 10.0 * frame; phaseY = 10.0 * frame; phaseZ = 10.0 * frame;";
string $shname[] = `listRelatives -shapes $pname[0]`;
setAttr ($shname[0] + ".visibility") 0;