XSIFactory.CreateFCurveParamDef
 
 
 

XSIFactory.CreateFCurveParamDef

Introduced

v5.0

Description

Creates an FCurve parameter definition for use with a CustomProperty or CustomOperator. An FCurve of this type is often called a "Profile Curve" because, unlike most FCurves, this curve does not animate any parameter, but instead is available for use in any fashion the plug-in developer or user wishes.

Unlike parameters that have simple types like an Integer or a String, this Parameter is an instance of an FCurve. It uses units of Frames for its x axis, but because it does not directly animate any object this axis can actually be interpreted in any fashion. An example use of an FCurve parameter can be found on the Bulge Operator.

The FCurve object is retrieved via the Parameter.Value method. This should not be confused with the method for retrieving an FCurve that is animating a "basic" parameter (the Parameter.Source method).

In order to view the FCurve on the Property Page for the CustomProperty or CustomOperator use PPGLayout.AddFCurve.

C# Syntax

ParamDef XSIFactory.CreateFCurveParamDef( String in_ScriptName );

Scripting Syntax

oReturn = XSIFactory.CreateFCurveParamDef( ScriptName );

Return Value

ParamDef

Parameters

Parameter Type Description
ScriptName String This argument specifies the ScriptName of a parameter (see Parameter.ScriptName). This name is also used as the name and description.

Examples

JScript Example

/*
        This example illustrates how to create an fcurve parameter 
        from a parameter definition.
*/
var o = Application.ActiveSceneRoot.AddCustomProperty( "MyProfileEditor" );
var param = o.AddParameterFromDef( XSIFactory.CreateFCurveParamDef("fc") );
// Set keys on profile curve
var fc = param.Value;
for ( var i = 0; i < 360; i=i+3 )
{
        fc.AddKey( (i/360) * 100, Math.sin( i ) * 100 );
}
// Set the ppglayout to show fcurve
var oLayout = o.PPGLayout;
oLayout.AddFCurve( "fc", 250 );         // 250 == height of editor

See Also

CustomOperator.AddParameter CustomProperty.AddParameterFromDef FCurve