Road Spline Editor
Main editor tool for creating and managing road splines - multi-layered DecalRoad-based road systems with support for materials, auto-generated detail layers, terrain painting, undo/redo, bitmap impor
Main editor tool for creating and managing road splines - multi-layered DecalRoad-based road systems with support for materials, auto-generated detail layers, terrain painting, undo/redo, bitmap import, and profile save/load.
Public API
| Function | Signature | Description |
|---|---|---|
M.setSelectedSplineIdx | (idx) | Sets the selected spline index for cross-tool selection |
M.setSelectedNodeIdx | (idx) | Sets the selected node index for cross-tool selection |
M.onSerialize | () | Serializes all road spline groups for session persistence |
M.onDeserialized | (data) | Restores road spline groups from serialized data |
M.onEditorGui | () | Main editor GUI callback - renders all UI and handles input |
M.onEditorInitialized | () | Registers the roadSplineEditor edit mode, window, and scene tree menu |
M.onClientEndMission | () | Cleans up all groups and templates when leaving a map |
Key Features
- Multi-layer road system: Each road spline supports multiple material layers with individual width, lateral position, texture length, render priority, and fade
- Auto-generated layers: Tread marks, road cracks, repair patches, center/edge/lane lines, edge blends - all toggled per-spline
- Terrain painting: Per-spline terrain material painting with configurable margin
- Bitmap import: Import road splines from PNG bitmap masks via skeleton tracing
- Scene tree integration: Convert DecalRoad selections to road splines via right-click menu
- Undo/redo: Full history support for all operations (single-group and trans-group)
- Profile save/load: Save/load layer profiles as JSON files
Dependencies
| Module | Purpose |
|---|---|
editor/roadSpline/groupMgr | Group management, deep copy, undo/redo |
editor/roadSpline/layerMgr | Layer CRUD, DecalRoad generation |
editor/roadSpline/import | DecalRoad-to-road-spline import |
editor/toolUtilities/splineInput | Shared spline mouse/keyboard input |
editor/toolUtilities/materialSelectionMgr | Material selection UI |
editor/toolUtilities/render | Debug rendering |
Usage Example
-- The road spline editor is activated via editor edit modes:
editor.selectEditMode(editor.editModes.roadSplineEditor)
-- Programmatic access to spline data:
local groups = extensions.editor_roadSpline_groupMgr.getGroups()
for i, group in ipairs(groups) do
print(group.name, #group.nodes, "nodes", #group.layers, "layers")
endSee Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Road River GUI
Shared GUI utilities for the Road/River editor tools, providing highlight colors, node sizing, and toolbar creation.
Road Template Editor
Editor window for creating, editing, saving, and loading road templates - composite road definitions with multiple DecalRoad layers, 3D decorations, and random decal patterns.