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.
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
sourcefield, 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.
Scoped to this part · feeds back into the world's score.