Skip to content

Scene API

The Scene API gives Lua scripts full control over Plinken’s 3D scene graph. Import models, create lights, animate characters, and control post-processing — all from code.

local scene = pl.scene
local scene = pl.scene
-- Load models (any format)
local character = scene:load("assets/singer.glb")
scene:load("props/mic_stand.obj")
-- Add a light
local key = scene:create_light("Key", "directional")
key.intensity = 8.0
key.direction = { x = -0.5, y = -1, z = -0.3 }
-- Set up camera
local cam = scene:create_camera("Main", "perspective")
cam.fov = math.rad(50)
cam.position = { x = 0, y = 1.6, z = 5 }
cam:look_at({ x = 0, y = 1, z = 0 })
scene:set_active_camera(cam)
-- Play animation synced to timeline
local idle = scene:get_animation("Idle")
idle.loop = true
idle:play()
idle:sync_to_timeline(0)
  • Models — Import and export 3D models (glTF, OBJ, STL, USDZ, FBX)
  • Nodes — Scene graph hierarchy and transforms
  • Meshes — Geometry, morph targets, procedural shapes
  • Materials — PBR metallic-roughness properties
  • Textures — Image loading and sampling
  • Lights — Directional, point, spot, and area lights
  • Cameras — Perspective, orthographic, viewports
  • Animation — Playback, morph targets, timeline sync
  • Skeleton — Joint access and procedural posing
  • Environment — Ambient, HDRI, sky, fog
  • Post-Processing — Bloom, tone mapping, SSAO
  • Shadows — Shadow maps, cascades, soft shadows
  • Render Settings — Anti-aliasing, background, debug stats
  • Math Helpers — vec3, quat, mat4 operations
  • Raycasting — Picking and scene queries