ScriptTrack

Paint a layer with Luau. Return one function of time and draw whatever you like into it, from a scene through its camera to pictures made by nodes.

A ScriptTrack is a layer of a CookVideo and a ModuleScript at once. Its source returns function(time); while the playhead is between InPoint and OutPoint, in Play mode and in renders, the function is called with the video's time and draws into the track's own image, for example with scene:RenderTo(script). A function that errors is tried again next frame, and its layer is left out until it runs cleanly. See Scripts.

Example

A shot that turns a part with a track and films itLuau
local video = script.Parent
local spin = video.Spin
local spinner = video.Scene.Spinner

return function(time)
	spinner.CFrame = CFrame.Angles(0, spin:ValueAtTime(time), 0)
	video.Scene:RenderTo(script)
end

Properties

Scripts

NameTypeDefaultDescription
DrawnFromCamerascripts onlyThe camera whose RenderTo drew this picture; a viewport showing it looks and edits through that camera.
Pathstringscripts only

Track

Offsetnumber0Places the animation of the instances in this clip; the script itself still gets video time.

Layout

ScaleVector21, 1Multiplies the drawn size around the AnchorPoint, which stays put, like After Effects.
Rotationnumber0Turns the layer around its AnchorPoint, in degrees.

Layer

BlendModechoice"Normal"
Normal, Dissolve, Darken, Multiply, ColorBurn, ClassicColorBurn, LinearBurn, DarkerColor, Lighten, Screen, ColorDodge, ClassicColorDodge, Add, LighterColor, Overlay, SoftLight, HardLight, VividLight, LinearLight, PinLight, HardMix, Difference, Exclusion, Subtract, Divide, Hue, Saturation, Color, Luminosity, StencilAlpha, StencilLuma, SilhouetteAlpha, SilhouetteLuma, AlphaAdd, LuminescentPremul
Blends the layer with any Photoshop or After Effects mode; Stencil and Silhouette cut the layers below it.
MattesourceIts track matte: any image, such as another track or an AOV; a sibling track is sampled through its own transform, anything else stretches over the canvas.
MatteModechoice"None"
None, Alpha, AlphaInverted, Luma, LumaInverted

Appearance

ColorColor31, 1, 1Tints the layer with this colour.
Transparencynumber0
0 to 1
Fades the layer.
VisiblebooleantrueTurned off, hides the layer in the composite.

Animation

InAnimationchoice"None"
None, Fade, Slide, Pop, Typewriter, Wipe
How the layer animates in at its clip's In point; applied when drawn, so keys and scripts stay untouched.
InDurationnumber0.5
0 to 1e+06
How long the In animation lasts; in the Cook window, drag the inner edge of its ramp.
OutAnimationchoice"None"
None, Fade, Slide, Pop, Typewriter, Wipe
How the layer animates out at its clip's Out point; applied when drawn, so keys and scripts stay untouched.
OutDurationnumber0.5
0 to 1e+06
How long the Out animation lasts; in the Cook window, drag the inner edge of its ramp.
SlideDirectionchoice"Left"
Left, Right, Up, Down
AnimationEasingchoice"Smooth"
Smooth, Linear, Back
AnimationStartnumber0
AnimationEndnumber-1

Layer Style

FillOpacitynumber1
0 to 1
Fades the layer's own pixels but not its layer styles, like Photoshop's Fill.
From CookLayer 6
From ModuleScript 1
From Base2D 18
From CookClip 4
From LuaSourceContainer 1
From BaseImageContent 6
From Instance 22