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.
Entry Point
Section titled “Entry Point”local scene = pl.sceneQuick Example
Section titled “Quick Example”local scene = pl.scene
-- Load models (any format)local character = scene:load("assets/singer.glb")scene:load("props/mic_stand.obj")
-- Add a lightlocal key = scene:create_light("Key", "directional")key.intensity = 8.0key.direction = { x = -0.5, y = -1, z = -0.3 }
-- Set up cameralocal 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 timelinelocal idle = scene:get_animation("Idle")idle.loop = trueidle:play()idle:sync_to_timeline(0)API Reference
Section titled “API Reference”- 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