02 — Components
Subsystem diagram: data-model.html · Traces: trace-components · trace-guid · trace-exposed · Feature list: 13 — Feature List
How the Babylon Object panel authors per-object gameplay data. The runtime never reads Blender PropertyGroups directly — only the manifest rows you export.
Component stack UI
Select an object → Babylon Object → Add Component. Each row is one manifest entry when enabled:
- Header — enable toggle, type name, ▾ menu (duplicate, copy/cut/paste, reorder, delete)
- Body — type-specific fields (collider shape, script path, audio file, …)
- Pin (header) — lock the inspector to this object while you pick targets in the viewport
Cut/paste moves a component to another object; copy/paste duplicates it. Clipboard is session-scoped.
GUID identity
Adding a component (or Assign GUID) stamps bjs_id on the object. That id rides in glTF node extras and manifest entities[].id — renaming the object in Blender does not break links.
Entity references (@exposed({ type: "entity" }), camera targets, Event Message targets, constraints) store GUIDs, not names. Trace: trace-guid.
Event Messages (colliders)
On any Collider component, the Event Messages section lists authored reactions: When (Trigger Enter/Exit, Collision Enter/Exit), Target entity, Message string, optional Only Tag filter. At runtime the engine dispatches matching rows via SendMessage → target behaviors' OnMessage. Trigger-phase rows on non-trigger colliders (and collision-phase rows on pure triggers) warn at export. See 06 — Physics › Event Messages.
Script components and @exposed
- Open Script… — pick a
.tsbehavior file; registry key = filename stem (Rotator.ts→Rotator) - Exposed fields appear as typed widgets (parsed from source — not executed)
- Sync — refresh widgets after you change
@exposed/@inputMapin code
Cross-language rules: decorator stays lowercase @exposed; single-line literal defaults; press Sync after edits. Entity fields need type: "entity" in the decorator. Trace: trace-exposed. Runtime scripting: 05 — Scripting.
Collider preview
On a selected object with a Collider, enable Show Preview to draw a cyan wireframe in the viewport. Manual size/offset/rotation are in Blender axes (what you see); export converts to Babylon Y-up. Convex/mesh shapes use the mesh geometry — no separate wireframe.
Trace: trace-collider-preview. Dynamic bodies also show a center-of-mass cross when preview is on: trace-cog-preview.
Compound colliders
Multiple enabled Collider rows on one object merge into one physics body at runtime. The panel numbers headers (Collider 1/3, …) and shows a compound notice.
Reflection probe preview
On a selected object with a Reflection Probe, enable Show Influence Preview to draw a warm yellow wireframe of the influence volume (box or sphere) in the viewport. Place an Empty at the capture point, size the influence box to cover only the glossy meshes that need local reflections (walls, floor, props) — not the whole level. Leave Refresh Rate on Once unless reflected geometry animates.
Render All captures every scene mesh into the cubemap (minus excludes and the probe host). Turn it off to author an explicit render list. At runtime, level meshes inside the influence volume get the probe cubemap on PBR reflectionTexture; the visible skybox is always excluded and keeps scene IBL.
Real-Time Filtering (PBR section) improves how glossy materials sample the probe — it does not change what the probe captures. For sky-heavy reflections, use Babylon Scene › Environment instead of enlarging the probe volume.
Runtime: 07 — Rendering › Reflection probes.
Rendering group & layer mask
Two optional components under Rendering control how Babylon draws or filters meshes. They are not the same as a logical Tag (gameplay label) or Babylon’s 2D Layer overlay class.
| Component | Babylon property | What it controls |
|---|---|---|
| Rendering Group | mesh.renderingGroupId | Draw order — groups 0–3 render in ascending order (useful for transparency sorting and overlays). Also applies to this entity’s particle systems. |
| Layer Mask | mesh.layerMask | Camera / light visibility — a mesh renders when (mesh.layerMask & camera.layerMask) !== 0. Used for multi-camera HUD setups. |
Both components share two toggles:
- Apply to Owned Meshes (default on) — sets meshes this entity owns (same ownership rule as colliders and reflection probes: own geometry and primitive splits, not nested child-entity meshes).
- Apply to Child Entities (default off) — propagates the value down the Blender parent hierarchy until a descendant defines its own component of the same kind.
If a toggle is off, that scope keeps Babylon defaults (rendering group 0, layer mask 0x0FFFFFFF). A child’s own Rendering Group or Layer Mask always supersedes the parent for that branch — regardless of the parent’s toggles.
Layer Mask presets: Default (0x0FFFFFFF), Slot 0–3 (0x10000000 … 0x80000000 — typical HUD / overlay bits), or Custom (full 32-bit value). Matching cameras must use the same mask in app code for exclusive visibility.
Runtime detail: 07 — Rendering › Render layers · Feature trace: 10 — Feature Traces.
Collision layer (physics)
Under Physics, the optional Collision Layer component assigns one named layer from the scene master list (authored in Babylon Scene › Collision Layers). At runtime the engine resolves the scene matrix into Havok filterMembershipMask / filterCollideMask on every physics shape on the entity's body.
Two toggles mirror render layers:
- Apply to Owned Colliders (default on) — sets filters on this entity's physics shapes (requires a Collider and/or Rigid Body).
- Apply to Child Entities (default off) — propagates the layer down the Blender parent hierarchy until a descendant defines its own Collision Layer.
Entities without this component (and no inherited propagation) keep Havok defaults — they collide with everything. Filtered pairs will not generate contacts or trigger events.
The component stores the layer name, so removing or reordering layers in the scene panel never silently retargets other components. If you rename a layer, re-pick it on components that used the old name — Validate flags stale layer names.
Runtime detail: 06 — Physics › Collision layers · Feature trace: 10 — Feature Traces.
Auto-derived blocks (not components)
These appear as child panels when relevant — no Add Component row:
- Light on lamp objects — color, energy, shadows
- Camera on camera objects — clip, FOV; optional Camera component for orbit/follow/geospatial
- Animation when NLA strips exist — auto-play clip, loop, speed
Full component table: 13 — Feature List.