CG・コンテンツ制作
  1. CG・コンテンツ制作トップ
  2. DAIKIN CG Channel
  3. UsersNotes
  4. キャラクター
  5. MotionBuilder のスプリングアニメーションとツール ; MotionBuilder Spring Animation&Tools
SUITE USERS NOTES

MotionBuilder スプリング や リジッドボディー アニメーションとツール
MotionBuilder Spring & RBD Animation and Tools

プロローグ;Prologue

mobu01_00
MotionBuilder について4ページ目になります。
スプリング的な動き、物理計算(RBD)についての考察や、ジョイント用のツールを紹介したいと思います。
この記事内容に関してご協力してくださった皆々様、感謝いたします。

This is 4th page about MotionBuilder .
Here , is showing Spring like animation , RBD , and useful tools .
Many Thanks to cooperations !! to whom let us write this information and tools.


> Relation Constraint を利用したスプリング的な動き;Spring like animation using Relation Constraint
・Damp(Rotation), Damp(Position)

> Relation Constraint を利用したスプリング的な動き;Spring like animation using Relation Constraint
・Damping(3D)

> Rigid Body の Joint の Spring ;Rigid Body , Joint Spring
・PhysicsSolver

> Rigid Body と アニメーションの Plot;Rigid Body and Plot Animation

> Rigid Body と Joint;Rigid Body and Joint

> Rigid Body の JointTool;Rigid Body JointTool
・JointTool_cool.py(2012, 2013,2014)
Windows7 Professional 64Bit、Intel Core i7-3930K(3.20GHz,6コア/12スレッド)
メモリ16GB、NVIDIA GeForce GTX560 Ti 2GB(メモリ2GB)
izt_ritaro_ml

RelationConstraintを利用したスプリング的な動き; Spring like animation using RelationConstraint
Damp(Rotation), Damp(Position)
MotionBuilderには、Softimage の ICE のように、
ノードをつなぎ合わせて目的の動作を作れるRetationConstraintというものがあります。
しかも ICE を知っている方は、似たような操作からRetationConstraintを素早く理解できます。
まずは、このRetationalConstraintで移動と回転をつなげてスプリング的な動きを作ってみましょう。

MotionBuilder has Visual programming , like ICE in Softimage , called RetationConstraint .
So , if familiar with ICE than it's very easy to handle this RetationConstraint .
To begin , let's join Transform and Rotation to make a spring like animation , using RetationConstraint .
mobu01_60
Cube を3つ取り出し、親子階層にし、Asset Browser のConstraintからRelationを画面上にドラッグ&ドロップします。
するとNavigator 上の Constraints 以下に Relation が作成されるので、それをクリックすると
中央の画面がRelation用の設定画面になります。作業はこの中で行います。
この時、中央の画面がConstraintSettings 以外の画面にならないように、左上のカギマークをロックにしておくと作業がしやすいです。

Get 3 Cubes and make it in a hierarchy , Drag&Drop the AssetBrowser > Template > Constraint > Relation to View port .
In Navigator > Constraints , there is Relation , click it .
Constraint Setting window will appear , Lock this window by clicking the ICON above .
mobu01_01
2番目のCube1を選択状態にしてAltキーを押しながら RelationConstraint 画面に持って来ると
Sender と Receiver を選択する表示 が出るので、両方を作成します。
続いて、Rotation 項目の中の Damp(Rotation)と Vecter 項目の中の Damp(Position)を取り出します。
もうなんとなく解りますよね。これらをつなぎ合わせます。このようなノード間を 接続して設定するのは、ICEに非常に似ています。

Select the 2ndCube1 , with ALT+LMB Drag&Drop cube1 to Constraint Setting window ,
make both Sender and Receiver node .
Get Rotation > Damp(Rotation) , Vecter > Damp Position node from Left Menu .
Knowing this kind of connections in ICE , can guess what to link .
mobu01_02
Rotation 同士をつなぎ、Tramslation 同士をつなぎます。
Number 項目からInteger を取り出し 各設定値を入力します。

Link Sender Rotation to Damp(Rotation)R [Vector] to Receiver Rotation ,
Link Sender Translation to Damp Position T [Vector] to Receiver Translation .
Get Number > Integer node .
mobu01_03
Integer は、左矢印部分を右マウスクリックするとSetValue となって数値を入力出来ます。
Dampingに1.0 Max acc に3500Max speedに400を接続します。

Click left side input with RMB in Integer node , will appear Set Value , put in numbers as follows .
Damping ; 1.0 , Max acc ; 3500 , Max speed ; 400 . and link to it
mobu01_04
3個目の cube2 にも似た設定を施します。cube2のSenderとReceiverを作ります。
領域選択を使って複数を選択状態にし、コピー(Ctrl+C)ペースト(Ctrl+V)します。

Do same thing to the 3ndCube2 , make both Sender and Receiver node .
Use Copy(Ctrl + C ) and Paste(Ctrl + V) to make another set .
mobu01_05
Damping に1.0Max accに3450Max speedに200を設定します。

Change some numbers as , Damping ; 1.0 , Max acc ; 3450 , Max speed ; 200 .
mobu01_06
親である1個目の cube を移動させたり回転させたりすると、遅れて追従する動きが得られます。

Moving and Rotating the first parent cube , others will follow with different velocity .
mobu01_07



RelationConstraintを利用したスプリング的な動き ; Spring like animation using RelationConstraint
Damping(3D)
上記設定でも面白い動きをするのですが、動きが収まる時の挙動に不自然さが残ります。
そこで、同じような手法とノード名なのですが、Damping(3D)と いうノードがあるので、これを使ってみます。

Cubeを3つ取り出し、親子階層にし、Asset Browser の ConstraintからRelationノード を画面上にドラッグ&ドロップします。
Navigator上の Constraints 以下の Relation をダブルクリックして中央の画面をRelation用の設定画面にします。
階層下の2つCubeを選択状態にしてAlt+左マウスクリックの状態でドラッ グ&ドロップすると、SenderとReceiverを素早く作成できます。

Above settings has some unlike movement when settling.
Next one will use Damping(3D) node.
Do the same setting with 3 Cubes.
mobu01_10
Number 項目の中のIntegerとOther 項目の中のDamping(3D)を取り出します。
Damping(3D)は、各ノードの Rotation と Translation に接続するので、2個ずつ、合計4個用意します。

Get Number > Integer node , Other > Damping(3D) node .
Damping(3D) is used both Rotation and Translation , so get 4 of them .
mobu01_11
各値をつなぎ、Integerには20.00を 設定して、全部の Damping(3D)の Damping Facter に接続します。

SetValue 20 to Integer node and link it to Damping(3D); Damping Facter .
mobu01_12
各かなりいい感じの動きになっていると思います。

This has more good moving .
mobu01_13



Rigid Body の Joint の Spring ;Rigid Body , Joint Spring
PhysicsSolver
さて、次は MotionBuilder 2013 に用意されているPhysicsSolver まり物理計算を利用した ものを紹介します。
PhysicsSolver には2つのエンジンが選べ、ODE 0.11とPhysX 2.8.3があります。
この RBD のJoint 設定にSpringがあり、同じくバネ的な動きが可能で、衝突判定を付けられる点が RBDの利点です。
3つの Cube を用意し、2つの Null を2つのCubeの位置に設定します。
この Null に Joint の設定をするのですが、階層構造にはしないで先に進み ます。

This time , is RigidBodyDynamics in MotionBuilder 2013 , node to use is PhysicsSolver inside AssetBrowser .
PhysicsSolver has 2 Physics Engine , ODE 0.11 and PhysX 2.8.3 .
In this RBD , there is Spring setup inside Joint , and can also get collision .
Get 3 Cubes and 2 Nulls , place the null to cube and cube1 .
Nulls are to set joint , but don't put them in hierarchy .
mobu01_20
AssetBrowser の Solver 項目から PhysicsSolver をシーン画面にドラッグ&ドロップします。
Navigator 画面の Solver項目内にPhysics Solver が追加され、クリックすると Solverタブの設定画面が表示されます。

Drag&Drop the AssetBrowser > Template > Solver >  PhysicsSolver node to VIew port .
Physics Solver will apear in Navigator > Solvers , with click , Solver Tab will show .
mobu01_21
AssetBrowser の Physics Properties 項目から RigidBody を、Cube1に 1つ、
Cube1と2を選択した状態でもう1つ上にドラッグ&ドロップすることで 設定します。
Navigatorで見ると、Cube1と2には共通設定として設定されています。

Drag&Drop one AssetBrowser > Template > Physical Properties > RigidBody to cube .
Select both cube1 and cube2 , Drag&Drop one AssetBrowser > Template > Physical Properties > RigidBody to them .
See Navigator that cube1 and cube2 has same RigidBody1 node as common setting .
mobu01_22
Cube に設定したRigidBody の設定では、ActivationをPassive にし、
Cube1 と 2 に設定したRigidBody の設定 では、Correct Mass Center のチェックを外しておきます。

Set cube's RigidBody as Activation > Passive ,
cube1 and cube2 's RigidBody is Activation > Active , and check OFF the Correct Mass Center .
mobu01_23
各Nullにそれぞれ、AssetBrowser の Physics Properties 項目からJointをド ラッグ&ドロップします。
最初のJointの設定では、CubeとCube1の 順に選択したものをConnections項目上にドラック&ドロップすると必要な入力設定をしてくれます。
同様にJoint1の設定も、Cube1とCube2 の順に選択したものを、Connections項目に設定します。
まだ、Joint の Type は Ball になっています。

Get AssetBrowser > Template > Physical Properties > Joint to each Null ,
set to first Joint , select cube and cube1 , Drag&Drop to Joint.Connections , will set up connections automaticly ,
next , to second Joint , select cube1 and cube2 , Drag&Drop to Joint.Connections .
Joint Type is still Ball .
mobu01_24
ここまで来たら、必ずシーンを一旦保存しておいてください。以下でシミュレー ションを実行した後、元の状態に戻したい場合には
ここで保存したシーンを読み直すということも必要になるかも知れないからです。

Nabvigator の Solver項目内 にPhysics Solver をクリックして設定画面を表示させ、
■ Onlineを■緑にして、Live とRecording に チェックが入ると物理計算が始まります。
今、ここでは先ほど見たJointの設定がBallになっているので、ブランブランと垂れ下がる動きになります。
これはこれで アクセサリーの動きとして面白いと思いますが、バネ的な動きに変えます。

Save the Scene once here .
Simulating something and want to goback to fix , backup is needed sometimes.
Nabvigator > Solver > Physics Solver , click and show the Solver Tab ,
put ■ Online to ■ , checks are on in Live and Recording , simulation will start .
Since Joint Type is Ball , it will hang down .
This is good move for some accessories , but want to change to Spring .
mobu01_25
各Jointの設定で、Type をBallからSpringに変えてから再度■ Online と、Live とRecording にチェックを入れてください。
今度はバネ的な動きになっているはずです。

Set the Joint Type to Spring , and simulate it .
This time it will be a spring animation .
mobu01_26
例えばプリミティブの pSphrer を取り出し、それにPassive設定のRigidBodyを付けると、各Cubeが衝突して動きます。

If you get a pSphre and set RigidBody as Activation > Passive , cubes will hit the pSphre .
mobu01_27



Rigid Body と アニメーションのPlot;Rigid Body and Plot Animation
さて、話は少し前後しますが、Rigid Body を改めて振り返ってみつつ、その動きを Plot する方法を紹介します。

MotionBuilder では、Rigid Body を扱う時、オブジェクトとして 赤色の Marker を良く使います。
Marker はAssetBrowserのElements >  Marker を View画面にドラッグ&ドロップして取り出します。
デフォルトでは Cube になっていますが、 Properties タブ内のMarkersettings の LookUI 項目のプルダウンメニューから
いくつかの形状に変更することが 出来、その形で衝突判定します。
Marker は、Null などを親にして幾つか組み合わせると、その 形状でも衝突判定をします。
この中で、Capsule は良く、ヒモや骨のように細長いもの に使います。

Introducing Rigid Body again , and show how to plot this animation .
In MotionBuilder , Marker is used as object for Rigid Body very often .
Get AssetBrowser > Template > Elements > Marker and Drag&Drop to View port .
Default LookUI is Cube , but can be changed to Sphere or Capsule , which can have collision in this shape .
mobu01_30
Rigid Body の設定を階層構造にしたNull、と個別の2つ Marker1 、Marker2 に 共有設定 で付けてみます。
Solver 項目から PhysicsSolver をView画面上 にドラッグ&ドロップして■ Online と、Live とRecordingにチェックを入れて実行状態にします。
すると、落下が始まり、Y軸が 0の値の平面 を地面として衝突し少し跳ねて動きが止まります。
[Reset to start] を押せば何回でもシミュレーションを行います。

Making a Null a parent to some Markers and set common Rigid Body setting ,it will collide with this shape .
Drag&Drop the AssetBrowser > Template > Solver >  PhysicsSolver node to View port .
Navigator > Solver > Physics Solver , click and show the Solver Tab ,
put ■ Online to ■ , checks are on in Live and Recording , simulation will start .
Pressing [Reset to start] , simulation will start again .
mobu01_31
この動きをシミュレーションなしで動くようにするには、Recorder のボタンを [ ● ] 赤色にしてシミュレーションを実行している状態で再生させるだけです。
とても簡単ですね。

To make Markers to move without Simulation , only press [ ● ] (Recorder Button)and start the frame , which will plot the animation .
Very easy .
mobu01_32
新しい機能として動きをファイルに書き出しつつ、Story 画面に Clip 表示させる方法があります。
まずはStory 画面で、右マウスクリック > Insert > Generic Animation Track を作成して、
Track Content 項目にView画面から動きを取りたいオブジェクトを選択して、Altキーを押しながらドラック&ドロップして登録します。
RecordModeという[ ○ ] のアイコンから RecordingOption 画面を表示させて、記憶したファイルが書き出されるディレクトリーを指定します。
Story 画面上部のRecord to Memory/Disk のボタンをクリックしてディスクに書き出すアイコンに変更します。

There is a new feature that can Plot Animation to Story's Clip , which is out putting animation data to a external FBX file .
In Story window , create RMB > Insert > Generic Animation Track ,
select all objects to Plot and Drag&Drop using Alt+LMB to TrackContent .
Open RecordingOption from [ ○ ](RecordMode) Button , set Path where to out put file .
Press [Record to Memory/Disk] to change to Disk .
mobu01_33
Recorder のボタンを [ ● ] 赤色にして、再生ボタンを押すと、Story のTrack上に Clipとして書き出されていきます。
Clipのソースは指定したディレクトリーにあります。Clipが存在するが、透明色で動かない場合は、
Properties 画面でそのClipの Laoded 項目でチェックが外れているからです。チェックを入れると色が付いて動くはずです。

Press [ ● ] (Recorder Button)and start the frame , which will plot the animation as Story's Clip.
If the Clip has no collor , Properties > Loaded check is OFF .
mobu01_34



Rigid Body と Joint; Rigid Body and Joint
では、上記で触れたように、カプセル形状の Marker を使って、尻尾やロープのような動きを作成してみましょう。
最初の MarkerはCubeのままして、Null を作成して左側に寄せて置き、次にまた Marker を作成して Capsule の形状にします。
Null とCapsule を同時に選択した状態で複製を作成して、どんどん延ばしていきます。
最初のCube の Marker は Rigid Body の設定を、Passive とします。
複数のCapsule の形状の Markerを同時に選択状態にして、共通の設定でActive とします。
複数のNull を同時に選択状態にして、共通の設定で Joint の設定をします。

Let's make a tail or rope like animation , using Capsule LookUI and Null Joints .
Leave the first Marker as Cube , make a Null on left side of it , make 2nd Marker as Capsule .
Select Null and Capsule , Copy&Paste as long as you want .
Set first Cube; Marker as AssetBrowser > Template > PhysicalProperties > RigidBody > Activation > Passive.
Select all Capsule; Marker and set AssetBrowser > Template > PhysicalProperties > RigidBody > Activation > Active as common setting .
Select all Null , set AssetBrowser > Template > PhysicalProperties > Joint as common setting .
mobu01_35
Jointの回転制限を一括して付けるには、全部を選択した状態で、Propertiesタブから設定します。
Hight Limit 40.00 30.00 40.00
Low Limit -40.00 -30.00 -40.00 としました。
Joint の Type は Ball になっています。この状態でLive状態で動きを見て調整します。

To set all Joint High And Low Limits at once , select all Null Joint node and set it in Properties tab .
Hight Limit 40.00 30.00 40.00
Low Limit -40.00 -30.00 -40.00
Joint Type is Ball , see how it moves in simulation .
mobu01_36
調整はなかなか難しく、少しの値でかなり変化する所と、やっと変化する所もあります。
Frictionはほんの少しの値で良く 0.20 、GlobalStrength 0.05、Global Elasticity 0.22 としました。

あとは、Liveの時の精度を上げる方法として、SamplePerFrame の値を 6 くらいに上げたり、
InteractionPerStep を 256 くらいに上げるといったことができます。

Some values are very low to set , that make a littel hard to know .
Friction is only 0.20 , GlobalStrength ; 0.05 , Global Elasticity ; 0.22 .

Other things to make animation look good , is to make SamplePerFrame up like 6 ,
and InteractionPerStep to 256 which is in Properties Tab .
mobu01_37



Rigid Body の JointTool;Rigid Body JointTool
JointTool_cool.py(2012, 2013,2014)
最後はこの Rigid Body をもう少し簡単に設定できる JointTool という pythonツールを紹介します。
各バージョンの py をユーザーのPythonStartupという ディレクトリー(無い場合は作成)してその中に保存します。
MotionBuilder を起動すると上部PythonTools プルダウンメニューにJoint ToolLast , is introducing a Python tool that can make up Rigid Body and Joints more easly .
It is called JointTool which can put in users PythonStartup directory .
After copying , JointTool will apear inside PythonTools pull down menu .
mobu01_40
MotionBuilder2012 JointTool_cool_2012.py 2.53 KB
(2012 SP2必要、Need 2012 SP2)

インストール場所;Install directory
C:\Users\ -UserName- \Documents\MB\2012-x64\config\PythonStartup
MotionBuilder2013 2014 JointTool_cool_2013.py 2.55 KB

インストール場所;Install directory
C:\Users\ -UserName- \Documents\MB\2013-x64\config\PythonStartup
C:\Users\ -UserName- \Documents\MB\2014-x64\config\PythonStartup

Softimage 上で尻尾かおさげのような骨構造体とポリゴンにエンベロープを設定して、FBXで書き出します。(Crosswalk 2014 使用)

In Softimage , make a tail like bones and polygon with envelope set .
Export the MODEL to FBX.(used crosswalk 2014)
mobu01_41
MotionBuilder にFBXを読み込んだら、スケールが小さいと思うので、一番上の階層のオブジェクトを選択して スケール値を X 10 , Y 10 , Z 10 にしておきます。
Marker を取り出し、骨の Root を同じ位置に置き、Marker を bone 以下の親とします。
PythonTools  > JointTool で設定画面を表示させ、最初の空欄に bone 、2つ目の空欄に Marker を、それぞれ選択してALTキーを押しながらドラッグ&ドロップして持っていきます。
[ ] AttachParent/Child constraint to Skeleton...項目にチェックを入れて有効にします。
後は、一番下の[Create] ボタンを押します。

In MotionBuilder open the FBX , which scale is small , select the top object and scale up to X 10 , Y 10 , Z 10 .
Get a Marker , set this to be the parent of bones.
In PythonTools > JointTool menu , set bone to the first space , Marker to the second , by Alt+LMB Drag&Drop .
Check On to [ ] AttachParent/Child constraint to Skeleton... .
Click the [ Create ] Button .
mobu01_42
親Marker にはRigidBody のPassiveを設定します。
JointTool で作成されたCapsel 型の Marker はスケールで大きさ調整します。

Set Marker as AssetBrowser  > Template > PhysicalProperties > RigidBody > Activation > Passive.
Scale the Capsel;Marker to fit inside polygon .
mobu01_43
Constraints 内の Parent/Child群を選択し、 Properties タブで
Snap 項目の[ Snap ]ボタンを押してから、全部のActive [ ]と次にLock [ ] にチェックを入れて有効にします。

In Navigator Constraints , select all Parent/Child nodes ,
click [ Snap ] inside PropertiesTab , and check ON Active [ ] , and Lock [ ] .
mobu01_44
Physical Properties内のChain Joint Property を選択し、AssetBrowserの Propertiesタブで
Typeを Universal 、Friction 0.20、Global Strength 0.04 、Global Elasticity 0.14 を設定してみました。

Select Physical Properties > Chain Joint Property , inside PropertiesTab
change Type to Universal , Friction ; 0.20 , Global Strength ; 0.04 , Global Elasticity ; 0.14 .
mobu01_45
Physical Properties 内の Chain Joint Property 内でChain J Joint 群を選択し、回転角度制限を付けます。
HighLimit の X 、Yに 30 Low Limit の X 、Yに  -30を一旦設定してみました。

Select all Physical Properties > Chain Joint Property > Chain J Joint ,
set HighLimit X , Y ; 30Low Limit X , Y ; -30 .
mobu01_46
その後、形を維持した動きにする為、Chain J Joint の回転制限は上から 0 5 20 40 と変更してみました。

After testing , changed Chain J Joint Limits , from top , 0 , 5 , 20 , 40's .
mobu01_47
Sample数を 6 に上げて、LiveをONにして動きの調整をしていきます。

Set SamplePerFrame up to 6 , see how it moves .
mobu01_48


さて、以上でツールの話は終わりなのですが、せっかくなのでもう少し探求してみます。
上記で説明したStory に Clip として動きを Plot  する方法で動きのデータを書き出し、Softimageに持って帰ってみます。

階層構造を元に近い形にして、親Null にキーアニメーションを設定してみました。

That's all for JointTool , but further investigation with Softimage .
Useing the NEW Plot to Clip method , import the external FBX file to Softimage .
Before doing so , make the hierarchy like the one imported .
mobu01_50
Story画面で Generic Animation Track を作成して、
Track Content項目にView画面から動きを取りたいオブジェクトを選択して、Altキーを押しながらドラック&ドロップして登録します。
RecordModeという[ ○ ] のアイコンからRecordingOption 画面を表示させて、記憶したファイルが書き出されるディレクトリーを指定します。
Story 画面上部のRecord to Memory/Disk のボタンをクリックしてディスクに書き出すアイコンに変更します。

In Story window , create RMB > Insert > Generic Animation Track ,
select all objects to Plot and Drag&Drop using Alt+LMB to TrackContent .
Open RecordingOption from [ ○ ](RecordMode) Button , set Path where to out put FBX file .
Press [Record to Memory/Disk] to change to Disk .
mobu01_51
書き出された FBX を Softimage に読み込みます。MotionBuilderで設定したスケールが 10のままアニメーションとして来るので、1に変更し、
階層構造の整理と、RootなどにY軸に回転値が入っていた場合は元の0に戻します。

Importing FBX to Softimage , Scale is too big , as it has scale 10 in FCurve animation , change it to 1 .
Rearrange the hierarchy , delete root Y Rotation value to 0 if any .
mobu01_52
第一boneのChain設定で FK/IKブレンドを0 = FK にします。
後は、アニメーションの付いているもの同士にコンストレインを設定します。親NullとEffectorにはPosition、各 boneにはPoseコンストレインを設定してみました。

First bone's Kinematic Chain settings , put FK/IK Blend to 0 . which is FK .
Make Position Constraint to Null and effector , Pose Constraint to bones .
mobu01_53
このようなビヨヨ~ンとしたアニメーションを設定することができました。

You Get same animation as in MotionBuilder .
mobu01_54

という訳で、次回は... What's Next ...
乞う、ご期待!!
戻る

お気軽にお問い合わせください

Daikin CG News お申し込み

CGクリエイター向けのセミナー・イベントやキャンペーン、製品情報をメールマガジンでお届けします。(登録無料)

Twitter

ページの先頭へ