Skip to content

3D scenes (PSL)

A 3D scene is a Motion composition written in PSL, Plinken’s scene language. It describes objects, what they are made of, how they are lit and how they move over time; Plinken renders it on your graphics card and bakes it to video like any other Motion clip. Use it for logo and product stings, turning objects, shots with a camera move. PSL draws no text: for titles and lower thirds use a regular clip, or show a picture of your title on a 3D card.

3D scenes need a browser with WebGPU (current Chrome or Edge on desktop).

In Motion → Library, under Seed from template, click one of the 3D templates — Spinning gear, Ball with props, Brass ball or Liftoff (3D shot) — to create a composition from it. Press Show code to see the scene next to the preview.

@param let tint: Color = rgb(0.85, 0.25, 0.1);
@param let size: Length = 0.8m;
@param let spin: Angle = 360deg;
fn card_mat(h: Hit, s: Sampler) -> Bsdf {
layer(dielectric_coat(1.5, 0.08), diffuse(tint))
}
fn view(t: Time) -> ~Scene {
let turn: Angle = spin * ease_in_out(tween(t, 0.2s, 2.0s));
scene(camera(point(0.0m, 1.0m, 5.0m), point(0.0m, 0.8m, 0.0m), 35deg),
[sun(dir(-0.4, -1.0, -0.6), rgb(1.0, 0.97, 0.92), 3.0)],
[prim("card", rounded_box(vector(size, size * 0.6, 0.06m), 0.05m),
translate(vector(0.0m, 0.9m, 0.0m)) * rotate_y(turn), card_mat)])
}
  • view(t) returns the scene at time t: a camera, lights, and objects (prim) with a shape, a placement and a material.
  • Units are part of the code: lengths in metres (0.8m), times in seconds (2.0s), angles in degrees (90deg). Mixing them up is an error the editor underlines.
  • Timing uses tween(t, from, to) with ease_in, ease_out, ease_in_out.
  • Errors are underlined in the code at their line, with a short explanation; the bake is blocked until the scene compiles.

Values marked @param are the scene’s props: they appear in the Props panel, so you can change the colour, size or timing without touching the code. Lengths are shown in metres, times in seconds, angles in degrees, colours with a colour picker. Change the code’s default and every prop you have not changed follows it; a value you set is kept.

Props are part of the bake: baking again with other props makes a new clip, and the clip on the timeline remembers the props it was baked with. Place the same scene twice with two looks by changing the props between bakes.

A scene can show files from the space’s Assets:

let logo = image("images/logo.png");
let clip = video_loop("video/waves.mp4");

Write the path as Assets shows it. A video plays in step with the scene; video_loop repeats, video holds its last frame. Videos stream from the space like on the timeline, so large files are fine. A missing file is underlined at its line until it is in Assets.

Bake and place a 3D scene like any Motion clip: see Bake and place. You can also ask Plinky to make or change a scene and put it on the timeline; keep the project’s Grid open while it bakes.