Decal Spline Populate
Handles the creation, placement, and removal of decal instances along a decal spline's path. Manages DecalData templates, round-robin/random component distribution, and per-component row/col propagati
Handles the creation, placement, and removal of decal instances along a decal spline's path. Manages DecalData templates, round-robin/random component distribution, and per-component row/col propagation.
Public API
| Function | Signature | Description |
|---|---|---|
M.populateDecalSpline(spline, splines) | Creates decal instances along a spline's div points | |
M.tryRemove(spline) | Removes all decal instances and unused templates for a spline | |
M.removeFolder() | Deletes the shared template SimGroup folder | |
M.propagateRowsCols(spline, componentIdx) | Syncs rows/cols across components sharing the same material |
Population Pipeline
- Sample arc-length:
geom.sampleSpline()along div points atdecalLength + spacingintervals - Compute component map: Assigns each position to a component (round-robin or weighted random)
- Create templates: One
DecalDataper unique material, registered in a shared SimGroup - Place instances:
editor.addDecalInstanceWithTan()with computed Frenet frame, jitter, pre-rotation
Component Map
Each position maps to:
| Property | Description |
|---|---|
path | Material name |
preRot | Pre-rotation quaternion (0°/90°/180°/270°) |
numRows / numCols | Texture atlas grid |
scale | Decal scale factor |
frame | Atlas frame index |
Distribution Modes
| Mode | Behavior |
|---|---|
| Round Robin | Cycles through enabled components evenly |
| Random | Weighted sampling based on componentXRandomWeight, uses spline.randomSeed |
Template Management
- Templates stored in a shared
SimGroupnamed"DecalSpline - Templates" - Instance counters track how many instances reference each template
- Templates auto-deleted when their instance count reaches zero
- Templates registered with
scenetree.decalPersistManfor persistence
Notes
- Assumed decal length: 4.0 meters
- Jitter applied as Z-only random rotation via
geom.computeRandomJitterQuat_ZOnly - Probability normalization ensures weights sum to 1.0 for random sampling
propagateRowsColsensures shared materials have consistent atlas settings
See Also
- Decal Spline Manager - Related reference
- World Editor Guide - Guide
Crawl Editor Waypoints
Class-based waypoint/pathnode editor for the Crawl Editor. Manages pathnode selection, gizmo manipulation, segment visualization, and the pathnode detail inspector with custom fields.
Decal Spline Manager
Core data management module for decal splines. Handles CRUD operations, deep copy, serialization, undo/redo, profile copy/paste, spline splitting/joining, bitmap import, and dirty-state updates.