anvil · documentation · gallery · llms.txt
Reference

SceneSpec

SceneSpec is a tagged union: LottieSpec | ThreeSpec, discriminated by kind.

Shared fields

id string, required
Stable identifier. Used for routes and caching.
kind "lottie" | "three", required
Selects the renderer.
title string
Human label.
description string
One-line description.
width, height number
Suggested render box, in pixels. CSS still controls layout.
background string
CSS background behind the canvas. Default transparent.

LottieSpec

kind: "lottie".

data LottieDocument, required
A full Lottie JSON document. Required numeric fields: fr, ip, op, w, h; layers must be an array.
loop boolean
Default true.
autoplay boolean
Default true.
speed number
Playback multiplier. Default 1.

ThreeSpec

kind: "three".

camera ThreeCamera
fov (deg, default 50), position (Vec3, default [0,0,5]), lookAt (Vec3, default [0,0,0]).
objects ThreeObject[], required
Each: name, geometry, optional material, position, rotation (Vec3), scale (Vec3 or number).
lights ThreeLight[]
Defaults to one ambient + one directional if omitted.
animate ThreeAnimation[]
Per-frame directives, applied by target name.
env object
background (hex string), autoRotate (radians/sec on the whole scene).

geometry.type

typefields
boxsize: Vec3
sphereradius, segments
torusradius, tube, segments
torusKnotradius, tube, p, q
planewidth, height
coneradius, height, segments
icosahedronradius, detail
pointscount, spread, size

material.type

standard
PBR, lit. color, emissive, emissiveIntensity, metalness, roughness, opacity, wireframe.
basic
Unlit flat colour.
normal
Debug normals.
points
For points geometry.

light.type

ambient
color, intensity.
directional
color, intensity, position.
point
color, intensity, position.

animate properties

rotation
axis: "x"|"y"|"z", speed: radians/sec.
bob
amplitude: world units, speed: oscillations/sec, optional axis.
pulse
amplitude: fraction of base scale, speed.