FreezeAndReplaceClips

Introduced

v1.5

Description

Freezes the input clips by plotting them into a new source action and replacing them with the newly created source action. It then deletes the input clips and creates a new track in the animation mixer, containing a new clip of the new frozen action.

Scripting Syntax

oString = FreezeAndReplaceClips( [InputObj], [Name], [IgnoreInactiveChannels], [StepFrame], [FCurve Kind], [DefaultSegKind], [Fit FCurve], [Fit Tolerance], [ProcessContRots] );

Return Value

Returns the fullname of the action as a String.

Parameters

Parameter Type Description
InputObj String List of clips

Default Value: Current selection

Name String Name of the frozen action.

Default Value: "FrozenAction"

IgnoreInactiveChannels Boolean Ignore inactive channels when freezing. If set to True, inactive items will not be added in the frozen action.

Default Value: True

StepFrame Double Step between frames.

Default Value: 1

FCurve Kind Integer What kind of fcurve do we want to plot to?

Default Value: 30

Possible Values:

Description:

10 BOOLEAN (value true or false)
15 INTEGER (staircase-like fcurve with integer values)
20 STANDARD (fcurve with spline/linear/constant interpolation)
30 RAWDATA (linear fcurve: less storage than a standard fcurve but with linear interpolation only)
DefaultSegKind Integer What kind of interpolation do we want for the resulting fcurves?

Note: Only relevant when FCurveKind is 20 (Standard).

Default Value: 3

Possible Values:

Description:

1 CONSTANT
2 LINEAR
3 CUBIC
Fit FCurve Boolean Do we want to fit an fcurve through the plotted values?

Default Value: False

Fit Tolerance Double What tolerance do we want for the fit?

Default Value: 0.01

ProcessContRots Boolean Do we want to process rotation curves to ensure their continuity?

Default Value: True

Examples

VBScript Example

'

' This example sets up two action clips for a sphere (one on the

' X-position and one on the Y-position), stores the actions, and

' then freezes the clips, creating a new one on a new track.

'

' Set up the scene 

Set oRoot = ActiveSceneRoot

Set oSphere = CreatePrim( "Sphere", "NurbsSurface", "MySphere" )

' Setting key frames on XPos and YPos at various frames

SaveKey oSphere.posx, 1, -9.0

SaveKey oSphere.posx, 10, 3.0

SaveKey oSphere.posx, 30,-3.0

SaveKey oSphere.posx, 40, 9.0

SaveKey oSphere.posy, 1, -2.0

SaveKey oSphere.posy, 30, 2.0

' Store fcurve into source Actions

Set oAct1 = StoreAction( oSphere, oSphere.posX, 2, "PlotXPosAction" , _

			True, 1, 40, True, False )

Set oAct2 = StoreAction( oSphere, oSphere.posy, 2, "PlotYPosAction" , _

			True, 1, 30, True, False )

' Add 2 tracks into the animation mixer, and add action clip with 

' the 2 sources action in tracks

Set oClip1 = AddClip( oRoot, oAct1, , , 1 )

Set oClip2 = AddClip( oRoot, oAct2, , , 1 )

' Create an XSICollection containing the 2 action clips 

Set oInputClips = CreateObject( "XSI.Collection" )

oInputClips.Add oClip1

oInputClips.Add oClip2

' Freeze action clips, and create a new one clip on a new track with 

' the clip collection

FreezeAndReplaceClips oInputClips, "FreezeXYPosAction", True, 1, _

			30, 3, False, 0.01, True

See Also

FreezeClips StoreAction PlotToActions