'
' 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" )
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
' Create a layer track and instantiate the Action onto it
set oTrack = AddTrack( "Scene_Root", , 5 )
set oClip = AddLayerClip( "Scene_Root", oTrack )
'==================================================
' 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 |