v1.0
カーブのパスに沿うよう、オブジェクトを拘束します。 このコマンドによるスクリプトは、オブジェクトに対して[アニメート] > [作成] > [パス] > [パスの設定]を選択することと同じです。 拘束元のカーブが指定されていないと、選択セッションが開始されます。
パスの比率を設定して、被コンストレイント オブジェクトをカーブの長さ全体のどの位置に配置するかを制御することもできます。 ゼロ パーセントに設定するとオブジェクトはカーブの開始に配置され、100% に設定するとカーブの長さ全体の 100% の位置に配置されます。 デフォルトでは、被コンストレイント オブジェクトは、指定した開始フレームと終了フレームの間のパスを端から端まで移動するようアニメーション化されます。
ApplyPath( [InputObjs], [Path], [StartFrame], [EndFrame], [NbKeys], [Linear], [Tangent] ); |
| パラメータ | タイプ | 説明 |
|---|---|---|
| InputObjs | 文字列 |
パスに配置するオブジェクトのリスト。 デフォルト値: 選択されたオブジェクト |
| Path | 文字列 |
パスとして使用するカーブ デフォルト値:ユーザがカーブを指定します。 |
| StartFrame | Double |
パス アニメーションの開始フレーム デフォルト値: 0 |
| EndFrame | Double |
パス アニメーションの終了フレーム デフォルト値: 0 |
| NbKeys | Long |
タイミング カーブに設定するキーの数 デフォルト値: 2 |
| Linear | Boolean |
リニア F カーブの場合は True、スプライン F カーブの場合は False デフォルト値: False |
| Tangent | Boolean |
オブジェクトにタンジェンシ コンストレイントを設定する場合は True デフォルト値: False |
'
' Applies a circular path to two cubes.
' One cube travels tangent to the path the other does not.
' The cubes travel in opposite directions.
'
dim oCircle,oCube1,oCube2
'
' Setup: create the circle and cubes
'
set oCircle = CreatePrim("Circle", "NurbsCurve")
oCircle.radius = 3
Rotate oCircle, -90, 0, 0, siRelative, siAdd, siObj, siXYZ
set oCube1 = CreatePrim("Cube", "MeshSurface")
set oCube2 = CreatePrim("Cube", "MeshSurface")
oCube1.length = 1
Scale oCube1, 2.5, 0.3, 0.3, siRelative, siLocal, siObj, siXYZ
oCube2.length = 1
Scale oCube2, 2.5, 0.3, 0.3, siRelative, siLocal, siObj, siXYZ
'
' Apply the paths to the cubes.
' Make oCube2 travel tangent to the path.
' By swapping the start and end frames, oCube2 will travel in the opposite direction.
'
ApplyPath oCube1, oCircle, 1, 100, 2, False, False
ApplyPath oCube2, oCircle, 100, 1, 2, False, True
'
' Display the path constraint relation in the top
' view of viewport A
'
SetValue "Views.ViewA.TopCamera.camvis.*constraint*", True
'
' Play the animation
'
PlayForwardsFromStart |