Master Spline - Layer Manager
Manages the layer system for master splines. Each layer represents a linked child spline (mesh, assembly, decal, or road) with lateral offset, flip, and width-tracking options.
Manages the layer system for master splines. Each layer represents a linked child spline (mesh, assembly, decal, or road) with lateral offset, flip, and width-tracking options.
Public API
| Function | Signature | Description |
|---|---|---|
M.getSliderDefaults | () → table | Returns default slider values for UI controls |
M.deepCopyLayer | (layer) → table | Deep copies a single layer |
M.deepCopyAllLayers | (layers) → table | Deep copies an array of layers |
M.updateAllLayers | (masterSpline) | Updates geometry for all layers |
M.updateOnlyDirtyLayers | (masterSpline) | Updates geometry only for dirty layers |
M.removeLayer | (idx, masterSpline) | Removes layer at index and its linked spline |
M.removeAllLayers | (masterSpline) | Removes all layers and their linked splines |
M.addNewLayer | (spline) | Adds a new default layer to the spline |
M.serializeLayer | (layer) → table | Serializes a layer to a plain table |
M.deserializeLayer | (data) → table | Deserializes a layer from a plain table |
Slider Defaults
| Parameter | Default | Description |
|---|---|---|
defaultLateralPosition | 0.0 | Lateral offset from spline center |
defaultDOI | 70.0 | Domain of influence |
defaultTerraMargin | 5.0 | Terraform margin |
defaultTerraFalloff | 1.5 | Terraform falloff |
defaultBankStrength | 0.5 | Auto-banking strength |
defaultAutoBankFalloff | 0.6 | Auto-banking falloff |
Layer Data Structure
{
name = "Layer 1",
id = "<UUID>",
isDirty = true,
isLink = false,
linkType = "Mesh Spline", -- tool prefix string
linkedSplineId = "<UUID>",
linkedSplineName = "...",
isFlip = false, -- reverse direction
isTrackWidth = false, -- track master width
position = 0.0, -- lateral offset [-1, 1]
}Layer Update Pipeline
- Laterally offset discretized points using
layer.positionand binormals - Apply RDP simplification to reduce point count
- Optionally flip geometry if
layer.isFlipis true - Send simplified geometry to linked spline via
linkUpdateJumpTable
Dependencies
editor/meshSpline/splineMgreditor/assemblySpline/splineMgreditor/decalSpline/splineMgreditor/roadSpline/groupMgreditor/toolUtilities/rdp
See Also
- Master Spline - Auto Road Generation - Related reference
- Master Spline - Homologation - Related reference
- Master Spline - Jump Tables - Related reference
- World Editor Guide - Guide
Master Spline - Jump Tables
Utility module containing jump tables (dispatch maps) for fast cross-tool operations between the Master Spline and compatible linked spline tools (Mesh, Assembly, Decal, Road splines).
Master Spline - Spline Manager
Core data management module for the Master Spline tool. Handles creation, deletion, serialization, undo/redo, splitting, joining, linking, and dirty-state updates for all master splines.