AddMarker

導入

v1.0

カテゴリ

animmixer

詳細

アニメーション クリップのマーカーを作成します。 マーカーにより、クリップ内のフレームをハイライトにしたり、トランジションをセットアップするのにクリップ上で開始フレームと終了フレームにマークを付けたりすることができます。 マーカーは、どのタイプの Clip (アクション、シェイプ、オーディオなど)にも作成できます。

スクリプト構文

oReturn = AddMarker( Model, Container, [Time], [Duration], [Name] );

戻り値

マーカーを CollectionItem Legacy オブジェクトとして戻します。

パラメータ

パラメータ タイプ 詳細
Model 文字列 マーカーを追加するモデル。
Container 文字列 マーカーを作成するコンテナ。 コンパウンド、トラック、クリップなどが対象となります。
Time ダブル マーカーを追加するフレーム。

デフォルト値: 現在のフレーム。

Duration ダブル マーカーのデュレーション

デフォルト値:0 (単一フレームへのマーカ)

Name 文字列 新しいマーカーの名前

VBScript の例

'
' This example creates an Action containing expressions.
' It then instantiates the source onto the mixer, and creates
' a series of markers on the clip -- one for each "zero-crossing"
' the object makes in the Y-axis.
'
NewScene , false
' Set up a suitable timeline for the example.
startFrame = 1
endFrame = 200
SetValue "PlayControl.In", startFrame
SetValue "PlayControl.Out", endFrame
' Create the object for our example.
set oSphere = CreatePrim( "Sphere", "MeshSurface" )
' Animate it to oscillate and speed up over time.
AddExpr oSphere & ".kine.local.posx", "-10 + T * 3"
AddExpr oSphere & ".kine.local.posy", "5 * cos( exp( T * 0.5 ) * 75 )"
' Make an Action out of this animation.
posParams = "/kine.local.posx,kine.local.posy,kine.local.posz"
set oSource = StoreAction( , oSphere & posParams, 3, "Wavy", True, 1, 200 )
' Instantiate the Action onto the mixer, starting at frame 1.
set oClip = AddClip( "Scene_Root", oSource, , , 1 )
' Now, let's find every time the sphere crosses zero in
' the Y-axis, and put markers on the clip at those times.
oldY = GetValue( oSphere & ".kine.local.posy", startFrame )
for i = startFrame to endFrame
        curY = GetValue( oSphere & ".kine.local.posy", i )
        if ( oldY <= 0 AND curY >= 0 ) OR _
                ( oldY >= 0 AND curY <= 0 ) then
                AddMarker "Scene_Root", oClip, i
        end if
        oldY = curY
next