< Previous | Contents | Next >

Methods

BezierSpline.AdjustKeyFrames (start, end, x, y, operation[, pivotx][, pivoty])

Set, Offset or Scale a range of key frames.

start, end Time range of keypoints to adjust (inclusive)

x, y Time and Value offsets/factors

operation Can be “set”, “offset” or “scale” (case sensitive)

pivotx, pivoty optional values to scale around. Default is zero.

> Parameters:

start (number) – start end (number) – end x (number) – x

y (number) – y

operation (string) – operation


image


pivotx (number) – pivotx

pivoty (number) – pivoty

BezierSpline.DeleteKeyFrames(start[, end])

Delete key frames.

> Parameters:

start (number) – start

end (number) – end

BezierSpline.GetKeyFrames()

Get a table of keyframes.

While Operator:GetKeyFrames() returns a table of the tool’s valid extent, and Input:GetKeyFrames() returns a table of the keyframe times for any animation, when GetKeyFrames() is called from a BezierSpline modifier, it will return a table fully describing the spline’s curvature.

The data returned consists of a table of subtables, one for each keyframe and with a key value of the keyframe’s time. The subtables contain an entry for the keyframe’s value, and optionally, subtables for the left and/or right handles, keyed by “LH” and “RH”. The handle subtables contain two entries, for the handle’s X & Y position.

}

[62.0] = { 2.5, LH = { 54.0, 2.5 } }

[38.0] = { 3.86, LH = { 25.333333, 3.666667 }, RH = { 46.0, 4.0 } },

[0.0] = { 2.0, RH = { 12.666667, 2.0 } },

{

Returns a table containing information about a spline control’s animation keyframes. An example table for a spline with three keyframes follows:


image

from pprint import pprint

# gets the spline output that is connected to the Blend input

splineout = comp.Merge1.Blend.GetConnectedOutput()

# then uses GetTool() to get the Bezier Spline modifier itself, and

> Python usage:



image



image

if splineout:

# then uses GetKeyFrames() to get a table of a spline data.

splinedata = spline.GetKeyFrames() pprint(splinedata)

spline = splineout.GetTool()

image

-- gets the spline output that is connected to the Blend input

splineout = Merge1.Blend:GetConnectedOutput()

-- then uses GetTool() to get the Bezier Spline modifier itself, and

if splineout then

splinedata = spline:GetKeyFrames()

dump(splinedata)

end

-- then uses GetKeyFrames() to get a table of a spline data.

spline = splineout:GetTool()

> Lua usage:



> Returns: keyframes

> Return type: table


BezierSpline.SetKeyFrames(keyframes[, replace])

Set a table of keyframes.

This function allows you to set a spline’s keyframes as well as its curvature. The table should consist of a table of subtables, one for each keyframe, each with a key value of the keyframe’s time. The subtables should contain an entry for the keyframe’s value, and may optionally contain subtables for the left and/or right handles, keyed by “LH” and “RH”. The handle subtables should contain two entries, for the handle’s X & Y position.

An example table for a spline with three keyframes follows:


image



}

[62.0] = { 2.5, LH = { 54.0, 2.5 } }

[38.0] = { 3.86, LH = { 25.333333, 3.666667 }, RH = { 46.0, 4.0 } },

[0.0] = { 2.0, RH = { 12.666667, 2.0 } },

{

> Parameters:

keyframes (table) – keyframes

replace (boolean) – replace