Object Hierarchy | 関連する C++クラス:Track
Track
v4.0
この Track オブジェクトは、ClipContainer内のシーケンスクリップに使用されたクリップのコンテナです。トラックオブジェクトを取得するには、ClipContainer.Tracksプロパティを使用します。トラックには、特定のタイプのクリップのみが含まれています。たとえば、オーディオクリップ(Clip.Type == siClipAudioType)はオーディオトラック(Track.Type == siTrackAudioType)内でのみ検索されるトラックタイプです。siTrackTypeに含まれているいずれかの値を戻す基本プロパティSIObject.Typeです。
トラックは、AddTrackコマンドを使ってのみ追加できます(現在、オブジェクトモデルを使用してトラックを加える方法が全くない場合)。
/*
This example demonstrates how to create a compound clip from scripting.
It also shows that when retrieving clips from the ClipContainer it only
returns clips that are on tracks nested directly under it.
*/
NewScene( null, false );
var oRoot = Application.ActiveSceneRoot;
var oCube = oRoot.AddGeometry( "Cube", "MeshSurface" );
// Creating the first animation source
var sParams = oCube + ".kine.local.posx," + oCube + ".kine.local.posy," + oCube + ".kine.local.posz";
var oSource = StoreAction( oRoot, sParams, 1, "StoredStaticPose", 1, 1, 5, 0, 0 );
// Creating the first clip
var oClip = AddClip( oRoot, oSource );
LogMessage( "First created clip " + oClip.FullName );
oCube.posx.Value = 3.0;
// Creating the second animation source
var oSource2 = StoreAction( oRoot, sParams, 1, "StoredStaticPose", 1, 7, 9, 0, 0 );
// Creating the second clip
var oClip2 = AddClip( oRoot, oSource2 );
LogMessage( "Second created clip " + oClip2.FullName );
// This function prints the clip names contained in a clip collection
function PrintClips(oClipCollection)
{
for (var i=0; i<oClipCollection.Count; i++) {
LogMessage( "Clip " + oClipCollection(i).FullName );
}
}
oMixer = oRoot.Mixer;
LogMessage( "List of clips retrieved from the container......." );
PrintClips( oMixer.Clips );
// Creating a compound clip from the clips created earlier
var myClips = new Array( oClip, oClip2 );
var oCompound = CreateCompound( oRoot, myClips );
LogMessage( "Compound clip " + oCompound.FullName );
LogMessage( "List of clips retrieved from the compound.......")
PrintClips( oCompound.Clips );
// Now retrieving once again the clips from under the mixer. This should only return the CompoundClip.
LogMessage( "List of clips retrieved from the mixer after the creation of the compound......." );
PrintClips( oMixer.Clips );
// Output of above script:
//INFO : First created clip Mixer.Mixer_Anim_Track.StoredStaticPose_Clip
//
//INFO : Second created clip Mixer.Mixer_Anim_Track1.StoredStaticPose1_Clip
//INFO : List of clips retrieved from the container.......
//INFO : Clip Mixer.Mixer_Anim_Track.StoredStaticPose_Clip
//INFO : Clip Mixer.Mixer_Anim_Track1.StoredStaticPose1_Clip
//
//INFO : Compound clip Mixer.Mixer_Anim_Track.CompoundAction_Clip
//INFO : List of clips retrieved from the compound.......
//INFO : Clip Mixer.Mixer_Anim_Track.CompoundAction_Clip.Mixer_Anim_Track3.StoredStaticPose_Clip
//INFO : Clip Mixer.Mixer_Anim_Track.CompoundAction_Clip.Mixer_Anim_Track4.StoredStaticPose1_Clip
//
//INFO : List of clips retrieved from the mixer after the creation of the compound.......
//INFO : Clip Mixer.Mixer_Anim_Track.CompoundAction_Clip |