v1.0
Creates a marker for an animation clip. Markers let you highlight and annotate frames in clips, such as marking a start frame and end frame on a clip to set up a transition. You can create markers on any type of Clip (for example, action, shape or audio).
oReturn = AddMarker( Model, Container, [Time], [Duration], [Name] ); |
Returns the marker as a CollectionItemLegacy object.
Parameter | Type | Description |
---|---|---|
Model | String | The model to add the marker to. |
Container | String | The container on which to create the marker. Could be a compound, a track, a clip... |
Time | Double |
Frame at which to add the marker. Default Value: Current frame. |
Duration | Double |
Duration of the marker. Default Value: Default value is 0 (a single-frame marker). |
Name | String | Name of the new marker. |
' ' 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 |