splatAssets
The shared half of the `sdfSplat` asset type: parses an asset's `splat.yaml` (cached by file version), and paints a placed copy of it under an entity's world transform through the package's `shapes` source (`paint` / `clear`). `SplatAsset.component`, the type's `behavior.luau` an…
splatAssets
The shared half of the sdfSplat asset type: parses an asset's splat.yaml
(cached by file version), and paints a placed copy of it under an entity's
world transform through the package's shapes source (paint / clear).
SplatAsset.component, the type's behavior.luau and its Inspector call it;
scripts rarely need to.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2module splatAssets The `sdfSplat` asset type's shared half: reads an asset's `splat.yaml` (a list of SDF primitive parts, each with a placement, a look and optional animation), caches it by file version, and paints it under any entity transform through the package's `shapes` source. Used by `SplatAsset.component` (one placed copy of an asset), by the type's `instantiate` / `inspect` / `validate`, and by its Inspector.
quatMul(a: { number }, b: { number }) → void
| arg | type | description |
|---|---|---|
| a | { number } | |
| b | { number } |
quatRotate(q: { number }, v: { number }) → void
| arg | type | description |
|---|---|---|
| q | { number } | |
| v | { number } |
axisAngle(ax: number, ay: number, az: number, deg: number) → void
| arg | type | description |
|---|---|---|
| ax | number | |
| ay | number | |
| az | number | |
| deg | number |
euler(e: { number }) →
Euler degrees (x pitch, y yaw, z roll; applied yaw, then pitch, then roll) to a quaternion.
| arg | type | description |
|---|---|---|
| e | { number } | `{ x, y, z }` in degrees. |
examples
splatAssets.euler({ 0, 45, 0 })num(v: any, default: number) → number
| arg | type | description |
|---|---|---|
| v | any | |
| default | number |
vec3(v: any, default: { number }) → void
| arg | type | description |
|---|---|---|
| v | any | |
| default | { number } |
colour(v: any, default: string) → void
| arg | type | description |
|---|---|---|
| v | any | |
| default | string |
isPrimitive(name: any) → boolean
| arg | type | description |
|---|---|---|
| name | any |
parse(text: string) → Parsed
Parse `splat.yaml` text into parts (no cache). Unknown or bad values fall back to defaults and are reported as problems.
| arg | type | description |
|---|---|---|
| text | string | The YAML text. |
examples
splatAssets.parse("parts:\n - shape: sphere\n")pathOf(ref: any) → string
| arg | type | description |
|---|---|---|
| ref | any |
read(ref: any) → Parsed
The parsed parts of an `sdfSplat` asset, re-read only when its `splat.yaml` changed.
| arg | type | description |
|---|---|---|
| ref | any | The asset (an `AssetRef<"sdfSplat">`) or its folder path. |
examples
splatAssets.read(asset.resolve("glowOrb", "sdfSplat"))bounds(parsed: Parsed) →
A local-space box enclosing every part of an asset (rotation and bob included), for framing, picking and previews.
| arg | type | description |
|---|---|---|
| parsed | Parsed | What `read` returned. |
examples
splatAssets.bounds(splatAssets.read(ref))
ensureBounds(root: any, parsed: Parsed, temporary: boolean?, resizeOnly: boolean?) → void
Give `root` (or refresh) its hidden bounds child: an invisible box the editor picks, the preview studio frames and the capture tool fits to.
| arg | type | description |
|---|---|---|
| root | any | The placed copy's entity. |
| parsed | Parsed | What `read` returned. |
| temporary | boolean? | Whether a new child stays out of the saved scene. |
| resizeOnly | boolean? |
examples
splatAssets.ensureBounds(root, parsed, false)
paint(key: string, parsed: Parsed, xf: { [string]: { number } }, t: number, budget: number, seed: number) → number
Paint one placed copy of an asset this frame: every part, placed under the given world transform and animated at time `t`.
| arg | type | description |
|---|---|---|
| key | string | Stable id of the copy (a component instance id). |
| parsed | Parsed | What `read` returned. |
| xf | { [string]: { number } } | `{ position = {x,y,z}, rotation = {x,y,z,w}, scale = {x,y,z} }` world transform. |
| t | number | Seconds the animation is at. |
| budget | number | Splat multiplier for every part (1 = as authored). |
| seed | number | A per-copy number so copies do not stroke identically. |
examples
splatAssets.paint(id, parsed, xf, os.clock(), 1, 0.3)
clear(key: string, count: number) → void
Stop painting a placed copy (parts 1..count).
| arg | type | description |
|---|---|---|
| key | string | The copy's id. |
| count | number | How many parts it painted. |
examples
splatAssets.clear(id, 4)
Part = {Parsed = {Module: parses sdfSplat assets (splat.yaml) and paints placed copies through the shapes source.Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.