AnimationSourceItem.SetAsFCurve

Description

Sets the source (DataSource) of the AnimationSourceItem as an FCurve. There are two ways you can use this method:

(1) Specify a new FCurve source (eg., after creating a new AnimationSourceItem with ActionSource.AddSourceItem() ).

(2) Replace an existing DataSource with an FCurve source.

C# Syntax

FCurve AnimationSourceItem.SetAsFCurve( Object in_KeyValueArray, Object in_vInterpolation, Object in_vType, Object in_vExtrapolation );

Scripting Syntax

oReturn = AnimationSourceItem.SetAsFCurve( KeyValueArray, [Interpolation], [Type], [Extrapolation] );

Return Value

FCurve

Parameters

Parameter Type Description
KeyValueArray Array of key data The array may be a 1- or 2-dimensional array. For 2-dimensional arrays the first dimension must define the key values. These contain 6 values per key for fcurves of interpolation type siCubicInterpolation (see siFCurveInterpolation) and 2 values for keys for the other fcurve interpolation types. The first value is the key time (in frames) and the second in the key value (in value units). For Cubic (or bezier) fcurves the remaining 4 values are the tangency values for: lefttanx (in frames), lefttany (in value units), righttanx (in frames), and righttany (in value units).
Interpolation siFCurveInterpolation The interpolation of the FCurve

Default Value: defined by parameter type

Type siFCurveType The type of the FCurve.

Default Value: defined by parameter type

Extrapolation siFCurveExtrapolation The extrapolation of the FCurve

Default Value: defined by parameter type

Examples

VBScript Example

' Create an ActionSource with one fcurve that will drive the global posx of anything called "Model".
NewScene , false
set oRoot = Application.ActiveProject.ActiveScene.Root
set oActionSource = oRoot.addactionsource("MyActionSource")
set oSourceItem = oActionSource.addsourceitem( "Model.kine.global.posx" )
set oFCurve =  oSourceItem.SetAsFcurve( Array(1,-10,,,,Empty,50,0,,,,Empty,100,50,,,,Empty) )
for each oKey in oFCurve.Keys
	LogMessage oKey.Time & ", " & oKey.Value
next
' Output of above script:
'INFO : 1, -10
'INFO : 50, 0
'INFO : 100, 50