Eyeon:Script/Reference/Applications/Fusion/Classes/BezierSpline/SetKeyFrames

From VFXPedia

Jump to: navigation, search

Tool : SetKeyFrames

Contents

Arguments

SetKeyFrames ( table splinedata )

  • splinedata (required, table)

A table of keyframe points and handles, formatted similarly to the table returned by BezierSpline:GetKeyFrames().

Returns

This function does not return any values.

Remarks

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:

{
    [0.0] = { 2.0, RH = { 12.666667, 2.0 } },
    [38.0] = { 3.86, LH = { 25.333333, 3.666667 }, RH = { 46.0, 4.0 } },
    [62.0] = { 2.5, LH = { 54.0, 2.5 } }
}

Requirements

  • eyeonScript 5.02
  • Fusion 5.02

Examples

local spline, splineout, splinedata
 
-- Copies any animation on Blur1.Blend to Blur2.Blend
 
-- gets the spline output that's connected to the Blend input,
splineout = Blur1.Blend:GetConnectedOutput()
 
-- then uses GetTool() to get the Bezier Spline modifier itself, and 
if splineout then
    spline = splineout:GetTool()
 
    -- then uses GetKeyFrames() to get a table of a spline data.  This
    splinedata = spline:GetKeyFrames()
end
 
-- Set up an empty spline on Blur2.Blend
spline = BezierSpline()
Blur2.Blend = spline
 
-- Set its keyframes with our spline data
spline:SetKeyFrames(splinedata)

See Also

GetKeyFrames()


Tips for SetKeyFrames (edit)

EyeonTips:Script/Reference/Applications/Fusion/Classes/BezierSpline/SetKeyFrames