v1.0
animmixer
クリップを作成し、指定されたモデルのミキサに追加します。 クリップは、ActionSource (アクションまたはシェイプ アニメーション)またはオーディオ ソース オブジェクトのインスタンスとなります。
oReturn = AddClip( Model, Source, [Compound], [Track], [Time], [Name], [ConnectionMappingTemplate], [ValueMappingTemplate], [ShareParent] ); |
Clip オブジェクトを戻します。
| パラメータ | タイプ | 詳細 |
|---|---|---|
| Model | 文字列 | クリップを追加するモデル |
| Source | 文字列 | クリップのソース。 通常、「ソース」はアクションです。 |
| Compound | 文字列 | このクリップを追加するコンパウンド コンテナ(トラックの所有者) |
| Track | 文字列 | このクリップを追加するトラック。 |
| Time | ダブル | クリップを追加するフレーム
デフォルト値: 現在のフレーム |
| Name | 文字列 | 新しいクリップの名前。 |
| ConnectionMappingTemplate | 文字列 | 新しいクリップに使用する接続マッピング テンプレート
デフォルト値:アクティブな接続マッピング テンプレート |
| ValueMappingTemplate | 文字列 | 新しいクリップに使用するバリュー マッピング テンプレート
デフォルト値:アクティブな値マッピング テンプレート |
| ShareParent | ブール | 別のモデルがソースとなっている場合に、ソースを共有します。
デフォルト値: True |
'
' This example creates a simple Action and instantiates it
' on two different objects using a connection mapping template.
' It shows very basic mixer scripting -- creating Actions, tracks
' and clips, as well as a simple mapping template.
'
' Create objects for our example.
set oSphere = CreatePrim( "Sphere", "MeshSurface" )
set oCone = CreatePrim( "Cone", "MeshSurface" )
posParams = "/kine.local.posx,kine.local.posy,kine.local.posz"
' Make an Action with it moving diagonally over 20 frames.
SetPositionKey oSphere, 1, -5, -5, 0
SetPositionKey oSphere, 20, 5, 5, 0
set oSource = StoreAction( , oSphere & posParams, 2, "Diagonal", True, 1, 20 )
' Create a track and instantiate the Action onto it, starting at frame 10.
set oTrack = AddTrack( "Scene_Root", , 0 )
set oClip = AddClip( "Scene_Root", oSource, , oTrack, 10 )
' Make the clip play with three bounce cycles.
SetValue oClip & ".actionclip.timectrl.extrapaft_type", 3
SetValue oClip & ".actionclip.timectrl.extrapaft_nbbounces", 3
' Now create a connection mapping template so that the same
' Action source can be applied to the cone.
CreateConnectionMap oCone, oSphere, oCnxMap
' Use the connection map to add another clip, so it will
' drive the cone instead. We don't specify a track so it
' will create a new one for the clip.
set oClip = AddClip( "Scene_Root", oSource, , , 1, "Slow", oCnxMap )
' Slow the cone's clip to play at one-quarter speed.
SetValue oClip & ".actionclip.timectrl.scale", 1/4
'==================================================
' Helper method to key an object somewhere at a given frame.
'==================================================
sub SetPositionKey( in_oObj, in_frame, in_posX, in_posY, in_posZ )
Translate in_oObj, in_posX, in_posY, in_posZ, siAbsolute, siParent, siObj, siXYZ
SaveKey in_oObj & posParams, in_frame
end sub
|