Function Curve

With the Function Curve functions, you can retrieve and modify values in the function curves.

The following is a list of the Function Curve functions:

addCtrlPointAfterPath3d
addKeyFramePath3d
angleEaseIn
angleEaseOut
holdStartFrame
holdStep
holdStopFrame
numberOfPoints
numberOfPointsPath3d
pointBiasPath3d
pointConstSeg
pointContinuity
pointContinuityPath3d
pointEaseIn
pointEaseOut
pointHandleLeftX
pointHandleLeftY
pointHandleRightX
pointHandleRightY
pointLockedAtFrame
pointTensionPath3d
pointX
pointXPath3d
pointY
pointYPath3d
pointZPath3d
removePointPath3d
setBezierPoint
setEasePoint
setHoldStartFrame
setHoldStopFrame
setHoldStep
setPointPath3d
setVeloBasedPoint

Example

The following script adds three function columns and sets the values for various points on the function curves.

function addSetFunctions()

{

/* creates the function columns if needed*/

if ( !column.add("3DPATH_FUNC", "3DPATH") )

System.println( "Error creating 3dpath column" );

 

if ( !column.add("BEZIER_FUNC", "BEZIER") )

System.println( "Error creating bezier column" );

 

if ( !column.add("EASE_FUNC", "EASE") )

System.println( "Error creating ease column" );

 

// adds 2 keyframes on a 3DPATH at frame 6 and 12

// with values x=2, y=2, z=1, tension=3, continuity=-1, bias=1

func.addKeyFrame3DPath( "3DPATH_FUNC", 6, 2, 2, 1, 3, -1, 1 );

func.addKeyFrame3DPath( "3DPATH_FUNC", 12, 2, 2, 1, 3, -1, 1

);

 

// removes a keyframe on 3DPATH at frame 12

func.removePoint3DPath( "3DPATH_FUNC", 12 );

 

// prints the number of points on a 3DPath column

var pathPoints = func.numberOfPoints3DPath("3DPATH_FUNC");

System.println( "3DPATH_FUNC column has " + pathPoints + "

points" );

 

// adds a keyframe on a BEZIER at frame 10 with values y=5,

// handle_leftx=9, handle_lefty=5, handle_rightx=12,

// handle_righty=-0.5, constant seg=false, continuity=smooth

if ( ! func.setBezierPoint( "BEZIER_FUNC", 10, 5, 9, 5, 12, -

0.5, false, "SMOOTH" ) )

System.println( "Error creating point on bezier" );

 

// sets the step value for a function column starting at frame

// 1 upto frame 15 hold 2

func.setHoldStartFrame("BEZIER_FUNC", 1);

func.setHoldStopFrame("BEZIER_FUNC", 15);

func.setHoldStep("BEZIER_FUNC", 2);

 

// prints the number of points on a function column

var bezPoints = func.numberOfPoints("BEZIER_FUNC");

System.println( "BEZIER_FUNC column has " + bezPoints + "

points" );

 

// adds a keyframe on an EASE at frame 10 with values y=5,

// ease_inx=0, ease_iny=0, ease_outx=0, ease_outy=180

// constant seg=true, continuity=straight

if ( ! func.setEasePoint( "EASE_FUNC", 10, 6, 0, 0, 0, 180,

true, "STRAIGHT" ) )

System.println( "Error creating point on ease" );

 

}

Related Topics 

Scripting Reference