isolate
Show the subject without the other geometry drawn, then put everything back.
isolate
Show the subject without the other geometry drawn, then put everything back.
A prop inside a built scene is behind whatever stands in front of it. The render-layer system already expresses "draw only these" — an entity is a member of layers, a camera renders a filter over them — but it does not remember what it displaced, so every caller wanting one clean shot of one thing hand-rolls the same record, swap and restore. This is that, once, with the restore guaranteed.
What it changes
Exactly one thing: the other geometry is not drawn.
Sky, post-process and UI are left exactly as the capture's own render-layer spec
stated them, so a final frame stays a final frame. A caller who wants the
geometry read flat — no lighting, no atmosphere — asks for a pass
(pass = "albedo", pass = "normal"), which is what passes are for.
What it does not change
Excluded geometry still casts shadows onto the subject and still bounces light into it. Lights are not filtered by render layer at all, and the layer mask drives object culling and the geometry passes rather than the shadow passes. This is the render-layer system's deliberate behaviour — a wall stays out of the shot while it still exists for lighting, shadows and physics — so a shadow with no visible caster in an isolated capture is the system working, not a bug.
The layer
One reserved layer name, captureIsolate, reused by every isolated capture.
Membership is a 32-bit mask with six reserved bits. A layer minted per call would
exhaust the namespace in twenty-six captures and leave a trail of empty layers
that renderLayer.list would show forever.
Restoring
begin records each affected entity's membership before moving anything, so the
token describes the whole subtree even if the move fails part-way. restore
puts every entity back to the layers it carried — and an entity that carried
no explicit membership ends with none, rather than an explicit default that
looks identical in a picture and different in the data.
restore is safe to call twice and safe on a token whose subjects have since
despawned, which is what lets a caller restore unconditionally on every exit
path: success, failure, and once around a whole collage grid rather than between
its cells.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2capture.toolbox/isolate.module/init.luau Show the subject without the other geometry drawn, then put everything back. The render-layer system already expresses "draw only these" — an entity is a member of layers, a camera renders a filter over them. What it does not do is remember what it displaced, so every caller wanting one shot of one thing hand-rolls the same record / swap / restore. This is that dance, once, with the restore guaranteed.
sceneLights( ) → void
The entities carrying the lights the default layer is shaded by. Lighting resolves by the same render-layer masks a camera draws through: a camera under isolation renders the isolate layer alone, so a subject alone on that layer would be drawn under no light at all. An isolation lends the layer to these lights for as long as it holds it, and each keeps its own membership, so the scene is shaded exactly as before while the frame is shaded as the scene is.
take(id: any) → void
| arg | type | description |
|---|---|---|
| id | any |
readLayers(id: string) → void
An entity's membership as layer NAMES, or nil when it carries none of its own. The difference matters on the way back: an entity that never had a RenderLayer component must end without one, not with an explicit "default" that looks identical in a picture and different in the data. The borrowed layer is left out of the answer, so what an isolation records as the entity's own is what the entity wears outside every isolation.
| arg | type | description |
|---|---|---|
| id | string |
onLayer(id: string) → boolean
Whether the engine reads this entity back as a member of the isolate layer.
| arg | type | description |
|---|---|---|
| id | string |
readName(id: string) → string
The name an entity carries, read while it is still in the scene. An isolation records it alongside the layers, so a message about a subject that has since left names it the way its author wrote it.
| arg | type | description |
|---|---|---|
| id | string |
subtree(rootId: string) → void
Every entity in a subtree, the root first.
| arg | type | description |
|---|---|---|
| rootId | string |
label(token: IsolateToken, id: string) → string
One subject of `token`, named the way its author wrote it.
| arg | type | description |
|---|---|---|
| token | IsolateToken | |
| id | string |
pending(token: IsolateToken?) → void
The subjects of `token` that are in the scene and that the engine does not read back on the isolate layer.
| arg | type | description |
|---|---|---|
| token | IsolateToken? |
lentPending(token: IsolateToken?) → void
The lights lent the layer under `token` that are in the scene and that the engine does not read back on it yet.
| arg | type | description |
|---|---|---|
| token | IsolateToken? |
departed(token: IsolateToken?) → void
The subjects of `token` that have left the scene since the isolation took them. An entity that is gone draws in no frame, so a picture taken under this token holds none of it — the same absence a subject taken off the layer leaves, reached another way, and named as its own reason.
| arg | type | description |
|---|---|---|
| token | IsolateToken? |
begin(targets: any) → void
Put `targets` (and everything under them) alone on the isolate layer. Returns a token to hand back to `M.restore`, or `(nil, reason)`. The token is returned even when a subject resolves to nothing renderable — restoring it is always safe, which is what lets the caller restore unconditionally.
| arg | type | description |
|---|---|---|
| targets | any |
heldError(token: IsolateToken?, where: string) → string
The reason a frame drawn under `token` does not contain the subject it isolated, or `nil` when every subject was still in the scene and on the layer. A camera under isolation renders the isolate layer and nothing else, so a subject taken off that layer — or out of the scene — while the render was in flight leaves a frame the renderer drew successfully with the subject absent from it. A capture asks this before it accepts the frame, so a picture of a scene that does not exist ends as a stated refusal rather than as the returned path of a written image.
| arg | type | description |
|---|---|---|
| token | IsolateToken? | |
| where | string |
restore(token: IsolateToken?) → void
Undo `M.begin` exactly. Safe to call twice, and safe on a token whose subjects have since despawned. An entity another isolation is still showing keeps the layer: the release that puts it back is the last one holding it, so a capture that ends while a second is mid-render leaves that second one's frame intact.
| arg | type | description |
|---|---|---|
| token | IsolateToken? |
cameraLayers(baseSpec: string?) → string
The render-layer spec a camera uses to see ONLY the isolated subject. Isolate stops the other geometry drawing and changes nothing else: whatever the capture's own spec said about sky and UI still holds, and its `postProcessing` is untouched, so a final frame stays a final frame. A caller who wants the geometry read flat asks for a pass — that is what passes are for. The subject's layer is added to the pass layers the capture already had, and every other geometry layer is left out by not naming it.
| arg | type | description |
|---|---|---|
| baseSpec | string? |
IsolateToken = {Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
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.