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.
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.
Public API
| Function | Signature | Description |
|---|---|---|
M.getToolPrefixStr() | → string | Returns "Decal Spline" |
M.getEditModeKey() | → string | Returns "decalSplineEditMode" |
M.getDecalSplines() | → table | Returns the decal splines array |
M.getSplineMap() | → table | Returns ID-to-index lookup map |
M.setDecalSplines(splines) | Replaces all splines | |
M.setDecalSpline(spline, idx) | Sets a single spline at index | |
M.getDefaultSliderParams() | → table | Returns default UI slider values |
M.addNewDecalSpline() | Creates a new spline with defaults | |
M.removeDecalSpline(idx) | Removes spline at index (with cleanup) | |
M.removeLinkedDecalSpline(id) | Removes a linked spline by UUID | |
M.removeAllDecalSplines(includeDisabled) | Removes all (or only enabled/unlinked) splines | |
M.splitDecalSpline(splineIdx, nodeIdx) | Splits spline into two at selected node | |
M.joinDecalSplines(idx1, node1, idx2, node2) | Joins two splines into one | |
M.deepCopyDecalSpline(spline) | → table | Deep copy (clears derived geometry) |
M.deepCopyDecalSplineState() | → table | Deep copies all splines |
M.copyDecalSplineProfile(spline) | → table | Copies style/material settings (no geometry) |
M.pasteDecalSplineProfile(spline, profile) | Applies profile to a spline | |
M.serializeDecalSpline(spline) | → string | Binary serialization via string.buffer |
M.deserializeDecalSpline(data, create) | → table | Deserialize from binary |
M.updateDirtyDecalSplines() | Recomputes geometry and repopulates dirty splines | |
M.convertPathsToDecalSplines(paths) | Converts bitmap-traced paths to splines | |
M.getCurrentDecalSplineList() | → table | Returns enabled splines as {name, id, type} |
M.isLinked(id) | → bool | Check if spline is linked to master |
M.setLink(id, groupId, isLink) | Set/clear link state | |
M.updateLinkedDecalSpline(id, pts, widths, nmls, isLoop, conform) | Update linked spline geometry | |
M.unlinkAll() | Unlinks all splines |
Undo/Redo Functions
| Function | Description |
|---|---|
M.singleSplineEditUndo(data) | Restores single spline from data.old |
M.singleSplineEditRedo(data) | Applies single spline from data.new |
M.transSplineEditUndo(data) | Restores full spline state from data.old |
M.transSplineEditRedo(data) | Applies full spline state from data.new |
Default Spline Parameters
| Parameter | Default |
|---|---|
spacing | 0.0 |
jitter | 0.0 |
numRows | 4 |
numCols | 2 |
scale | 1.0 |
frame | 3 |
rot | 1 (90°) |
randomSeed | 41225 |
| Default material | "asphalt_patches" |
Notes
- Uses
string.buffer(LuaJIT) for fast deep copy and serialization - Minimum spline divisions: 100; minimum import size: 10m
- Split supports loop unwrapping (open at split point) and open spline bisection
- Join concatenates geometry in correct order based on endpoint proximity
updateDirtyDecalSplinesperforms vertical raycasts, Catmull-Rom subdivision, random seed, then repopulation
Functions
singleSplineEditUndo(decalSplineData)
Handles single spline edit undo.
decalSplineData(any)
singleSplineEditRedo(decalSplineData)
Handles single spline edit redo.
decalSplineData(any)
transSplineEditUndo(data)
Handles trans spline edit undo.
data(table)
transSplineEditRedo(data)
Handles trans spline edit redo.
data(table)
unlinkAll()
Unlinks all decal splines (clears isLink and linkId, marks dirty).
See Also
- Decal Spline Populate - Related reference
- World Editor Guide - Guide
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
Drag Race Editor Constants
Centralized constants for the Drag Race Editor. Defines window settings, drag race types, phase names, tree types, context types, default transforms, UI dimensions, and debug colors.