GetFCurveInfo

Categories

animation

Description

Gets function curve information for a parameter.

Note: This command uses output arguments. C# and some scripting languages (such as JScript, PerlScript and Python) don't support arguments passed by reference so you need to use the best workaround for your situation:

For scripting languages this command returns an ISIVTCollection which you can use to get the output arguments.

For C# you can use the XSIApplication.ExecuteCommand method to call this command. ExecuteCommand packs the output arguments into a C# System.Object containing an Array of the output arguments (see Calling Commands from C#).

Scripting Syntax

GetFCurveInfo( InputObj, [CurveKind], [ValueWhenNoKey], [NbKeys], [ExtrapolationKind], [DefaultSegKind], [LowClamp], [HighClamp] );

Parameters

Parameter Type Description
InputObj String FCurve animation source.
CurveKind Integer Returns the type of function curve.

Possible Values:

Description:

0 UNKNOWN
10 BOOLEAN
15 INTEGER
20 STANDARD
30 RAWDATA
ValueWhenNoKey Double Returns the value of the function curve when it has no keys.
NbKeys Integer Returns the number of keys.
ExtrapolationKind Integer Returns the extrapolation type of the function curve.

Possible Values:

Description:

1 CONSTANT
2 LINEAR
3 PERIODIC
DefaultSegKind Integer Returns the default segment kind. Applies to standard function curves.

Possible Values:

Description:

0 DEFAULT
1 CONSTANT
2 LINEAR
3 CUBIC
LowClamp Double Returns the lower-clamping value.
HighClamp Double Returns the higher-clamping value.

Examples

1. VBScript Example

dim source, fcurve
dim crvtype, nokeyval, nbKeys, extrap, seq, lowclamp, highclamp
GetPrim "Null"
' Save some keys on the X position of the Null object
SaveKey "Null.kine.local.posx", 1, -5.0
SaveKey "Null.kine.local.posx", 25, 7.0
SaveKey "Null.kine.local.posx", 50, 2.0
' Get the FCurve animation source
set source = GetSource( "Null.kine.local.posx", siFCurveSource )
for each fcurve in source
        GetFCurveInfo fcurve, crvtype, nokeyval, nbKeys, extrap, seq, lowclamp, highclamp
        Application.LogMessage "Number of keys  : " & nbKeys
        Application.LogMessage "Value when no keys      : " & nokeyval
        Application.LogMessage "Type of fcurve  : " & crvtype
        Application.LogMessage "Extrapolation type      : " & extrap
        Application.LogMessage "Default segment type: " & seq
        Application.LogMessage "Lower clamp bound       : " & lowclamp
        Application.LogMessage "Upper clamp bound       : " & highclamp
next

2. JScript Example

// This example illustrates how to get access to the output
// arguments returned by the GetFCurveInfo command.
// Commands that don't explicitly define a return value but have output
// arguments in fact have an implicit return value which contains collection 
// object ( IVTCollection ). The .value is a method on this object.
// Create scene
NewScene("",false);
GetPrim("Null", null, null);
SetValue("null.Name", "null", null);
CreatePrim("Arc", "NurbsCurve", null, null);
SelectObj("null", null, true);
ApplyCns("Path", "null", "arc", null);
SaveKey("null.kine.pathcns.perc", 1, 0, null);
LastFrame();
SetValue("null.kine.pathcns.perc", 100, null);
SaveKey("null.kine.pathcns.perc", 100, 100, null);
// Get the fcurve from a string path
var col = GetSource("null.kine.pathcns.perc");
var src = col(0); 
// Get the fcurve info
var vtcol = GetFCurveInfo( src );
// Dump the fcurve info
Application.LogMessage( "CurveKind = " + vtcol.value("CurveKind") );
Application.LogMessage( "ValueWhenNoKey= " + vtcol.value("ValueWhenNoKey") ); 
Application.LogMessage( "NbKeys= " + vtcol.value("NbKeys") ); 
Application.LogMessage( "ExtrapolationKind= " + vtcol.value("ExtrapolationKind") ); 
Application.LogMessage( "DefaultSegKind= " + vtcol.value("DefaultSegKind") ); 
Application.LogMessage( "LowClamp= " + vtcol.value("LowClamp") ); 
Application.LogMessage( "HighClamp= " + vtcol.value("HighClamp") );

See Also

FCurve GetSource GetKeyInfo