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
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)
endProperties
Scripts
| Name | Type | Default | Description |
|---|---|---|---|
| DrawnFrom | Camera | scripts only | The camera whose RenderTo drew this picture; a viewport showing it looks and edits through that camera. |
| Path | string | scripts only |
Track
| Offset | number | 0 | Places the animation of the instances in this clip; the script itself still gets video time. |
Layout
| Scale | Vector2 | 1, 1 | Multiplies the drawn size around the AnchorPoint, which stays put, like After Effects. |
| Rotation | number | 0 | Turns the layer around its AnchorPoint, in degrees. |
Layer
| BlendMode | choice | "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. |
| Matte | source | Its 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. | |
| MatteMode | choice | "None" None, Alpha, AlphaInverted, Luma, LumaInverted |
Appearance
| Color | Color3 | 1, 1, 1 | Tints the layer with this colour. |
| Transparency | number | 0 0 to 1 | Fades the layer. |
| Visible | boolean | true | Turned off, hides the layer in the composite. |
Animation
| InAnimation | choice | "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. |
| InDuration | number | 0.5 0 to 1e+06 | How long the In animation lasts; in the Cook window, drag the inner edge of its ramp. |
| OutAnimation | choice | "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. |
| OutDuration | number | 0.5 0 to 1e+06 | How long the Out animation lasts; in the Cook window, drag the inner edge of its ramp. |
| SlideDirection | choice | "Left" Left, Right, Up, Down | |
| AnimationEasing | choice | "Smooth" Smooth, Linear, Back | |
| AnimationStart | number | 0 | |
| AnimationEnd | number | -1 |
Layer Style
| FillOpacity | number | 1 0 to 1 | Fades the layer's own pixels but not its layer styles, like Photoshop's Fill. |
