Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 07158574-5…

asset_instance_inspector

The `Asset` component's custom entity-inspector view: an instance of an asset placed in the scene, read against the asset it came from.

by◐lumi·posted 2d ago
What it does

asset_instance_inspector

The Asset component's custom entity-inspector view: an instance of an asset placed in the scene, read against the asset it came from.

The generic field grid shows the component's source, idMap and diff — a reference and two opaque tables. This view shows what they mean instead:

  • a summary of how the instance stands — in sync with its asset, or how many parts are edited, added or removed in the scene;
  • the source field, with the reference chip's reveal / open / replace;
  • Overrides — every part that differs from the asset, with what changed (position, name, Model tintR, …) and a Revert (or Remove, for an entity added under the instance);
  • Linked parts — every part still as the asset has it;
  • Revert all to asset, and Unpack into scene.

It reads the instance through the component's own overrides() and writes through revert(part?) and bakeIntoScene(), so the view holds no knowledge of how the diff is measured.

M.sections(entityId, proxy) answers the view as plain data; M.build(ctx) renders it into the entity inspector's card with the Context's widgets, the source field going through ctx.setSettings as one undoable edit.

local Inspector = require("@builtin::modules.editor.asset_instance_inspector")
local sections = Inspector.sections(entityId, entity(entityId).component.get("Asset"))

The Asset component's inspector.luau hands build to the entity inspector as the card's settings section, for every entity carrying the component.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

module editor.asset_instance_inspector The entity inspector's view of an Asset component — an instance of an asset placed in the scene. It says which asset the instance is linked to and how it stands against it: every part the asset composed, whether it is as the asset has it or was edited, removed or added in the scene, and what the edit changed. Each edited part can be reverted to the asset, selected, or the whole instance reverted or unpacked into plain scene entities.

selectEntity(id: string) → void

argtypedescription
idstring

countBadge(n: number, word: string, tone: string) → any

argtypedescription
nnumber
wordstring
tonestring

sections(entityId: string, proxy: any) → any

The view's sections for one Asset component: a summary of how the instance stands against its asset, its `source` field, the parts that differ from the asset and the parts that match it, and the actions that revert or unpack it.

argtypedescription
entityIdstringThe entity the component is on.
proxyanyThe live Asset component.

onChange(v: any) → void

argtypedescription
vany

onClick( ) → void

toneColor(P: any, tone: any) → string

The colour a view's `tone` names.

argtypedescription
Pany
toneany

build(ctx: any) →

The Asset component's card body on an entity (`edui.inspector`): the summary badges, the `source` field as the component's typed, undoable setting, the Overrides and Linked parts lists, and the revert / unpack actions, built from `M.sections` with `ctx.widgets`.

argtypedescription
ctxanyThe inspector Context of the Asset component on its entity.

runAction(what: string, fn: any) → void

An action runs, reports a failure, and rebuilds the Inspector with what it changed.

argtypedescription
whatstring
fnany

onChange(v: any) → void

argtypedescription
vany

onChange(v: any) → void

argtypedescription
vany

onClick( ) → void

onClick( ) → void

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

5items
▣
module · born here
❒asset
# editorSelection Named selection scopes for the editor. A scope is an independently tracked, ordered set of typed refs plus a primary (the last ref added or clicked). Distinct scopes never clobber each other, so viewport, outliner, inspector and asset browser share one answer to "what is selected" per kind. A ref is `{ kind: string, id: string }` — a stable id, never a display string, so rename/move never invalidates a selection. ## Exports - `M.scope(name) -> Scope` — get/create a named scope handle. - `M.set(scope, refs)` — replace refs in order; primary becomes the last. - `M.get(scope) -> { Ref }` — refs in click order (fresh array). - `M.primary(scope) -> Ref?` — last-clicked ref, or nil. - `M.clear(scope)` — empty a scope. - `M.toggle(scope, ref)` — add if absent, remove if present. - `M.add(scope, refs)` — add each ref not already present; primary becomes the last added. - `M.remove(scope, refs)` — remove each of `refs`; primary becomes the last remaining or nil. - `M.contains(scope, ref) -> boolean` — membership by `(kind, id)`. - `M.count(scope) -> number` — the scope's selection size. - `M.subscribe(scope, fn) -> handle` / `M.unsubscribe(scope, handle) -> boolean`. - `M.context() -> { scope, refs, primary }` — last-focused scope, for command ctx. ## Usage ```luau local Selection = require("@builtin::modules.api.editor.selection") local scope = Selection.scope("entity") Selection.set(scope, { { kind = "entity", id = "player_1" } }) Selection.subscribe(scope, function() refreshInspector() end) ``` ## Notes - State lives in a fixed `_G` slot, seeded pre-seal by the boot chain (`prelude.luau`); it survives hot-reload and edit↔play flips. Mutations after boot write into nested tables only. - `set` / `toggle` / `clear` mark their scope as last-focused, which drives `context()` and therefore which scope commands act on. - The service holds the editor's selection state in Luau. Refs handed back by `get` / `primary` / `context` are copies, so a caller can hold or mutate them without touching internal state.
▲ 0↑ born

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ 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".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.