Drive Path Editor - Spline Manager
Core data manager for drive path splines. Handles creation, deletion, splitting, joining, flipping, deep copying, serialization/deserialization, vehicle linking, nav graph caching, and geometry update
Core data manager for drive path splines. Handles creation, deletion, splitting, joining, flipping, deep copying, serialization/deserialization, vehicle linking, nav graph caching, and geometry updates (free mode + nav graph mode).
Public API
| Function | Signature | Description |
|---|---|---|
M.getToolPrefixStr | () → string | Returns "Drive Path Spline" |
M.getEditModeKey | () → string | Returns "drivePathSplineEditMode" |
M.getDrivePathSplines | () → table | Returns all drive path splines |
M.getSplineMap | () → table | Returns UUID → index map |
M.setDrivePathSpline | (spline, idx) | Sets spline at index, marks dirty |
M.setDrivePathSplines | (splines) | Replaces all splines |
M.computeActiveVehicles | () | Scans scene for active vehicles, populates internal list |
M.getActiveVehicles | (isForce) → table | Returns scene vehicles (recomputes if forced) |
M.getVehicleById | (vid) → table|nil | Finds vehicle by ID |
M.getNavGraph | () → table|nil | Returns cached nav graph data (nodes, widths, lines) |
M.getDefaultSliderParams | () → table | Returns default property values for UI sliders |
M.resetGeometry | (spline) | Clears all geometry arrays, marks dirty |
M.addNewDrivePathSpline | () | Creates new spline with defaults, updates map |
M.removeDrivePathSpline | (idx) | Removes spline at index, updates map |
M.removeAllDrivePathSplines | (isIncludeDisabled) | Removes all (or only enabled) splines |
M.splitDrivePathSpline | (splineIdx, nodeIdx) | Splits spline at node (loop unwrap or two halves) |
M.joinDrivePathSplines | (idx1, node1, idx2, node2) | Joins two splines at endpoints |
M.flipSpline | (spline) | Reverses node order and all per-node arrays |
M.deepCopyDrivePathSpline | (spline) → table | Deep copies a single spline |
M.deepCopyDrivePathSplineState | () → table | Deep copies all splines |
M.singleSplineEditUndo | (data) | Undo handler for single spline edits |
M.singleSplineEditRedo | (data) | Redo handler for single spline edits |
M.transSplineEditUndo | (data) | Undo handler for multi-spline operations |
M.transSplineEditRedo | (data) | Redo handler for multi-spline operations |
M.updateDirtyDrivePathSplines | (isBarsLimits) | Updates geometry for all dirty splines |
M.convertPathsToDrivePathSplines | (paths) | Imports traced bitmap paths as splines |
M.serializeDrivePathSpline | (spline) → table | Serializes spline to plain table |
M.deserializeDrivePathSpline | (data) → table | Deserializes spline from plain table |
M.resetVehiclePose | (spline, vehicle) | Positions vehicle at spline starting node |
M.linkSpline | (spline, vehicle) | Links spline ↔ vehicle |
M.unlinkSpline | (spline, vehicle) | Unlinks and restores cached vehicle pose |
M.relinkAllVehiclesToSplines | () | Re-establishes all vehicle links after deserialization |
Spline Data Structure
{
name = "Drive Path Spline 1",
id = "<UUID>",
isDirty = true,
isEnabled = true,
isFreeMode = true,
isVehicleLink = false,
linkVehId = nil,
-- Primary geometry
nodes = {vec3, ...}, widths = {num, ...},
nmls = {vec3, ...}, vels = {num, ...},
velLimits = {num, ...},
-- Secondary (computed) geometry
divPoints = {}, divWidths = {}, tangents = {},
binormals = {}, normals = {}, discMap = {},
ribPoints = {}, barPoints = {},
-- NavGraph mode
graphNodes = {}, graphPath = {},
-- Properties
delayTime = 0.0, routeSpeed = 31.3, aggression = 0.3,
numLaps = 1, isLoop = false, startingNode = 1,
isRouteSpeedLimit = false, isAvoidCars = true, isDriveInLane = true,
}Dependencies
| Module | Purpose |
|---|---|
editor/toolUtilities/geom | Catmull-Rom, bar points, ribbon geometry |
editor/toolUtilities/util | ID maps, unique names, raycasting, array copy |
Functions
computeActiveVehicles()
Computes active vehicles.
singleSplineEditUndo(drivePathSplineData)
Handles single spline edit undo.
drivePathSplineData(any)
singleSplineEditRedo(drivePathSplineData)
Handles single spline edit redo.
drivePathSplineData(any)
transSplineEditUndo(data)
Handles trans spline edit undo.
data(table)
transSplineEditRedo(data)
Handles trans spline edit redo.
data(table)
See Also
- Drive Path Editor - Playback - Related reference
- Drive Path Editor - Record - Related reference
- World Editor Guide - Guide
Drive Path Editor - Record
Records a vehicle's driven path into a new drive path spline. Samples position and velocity at a fixed interval, deduplicates close nodes, applies RDP simplification, and links the result to the recor
Dynamic Decals - Browser
Central browser window for the dynamic decals tool. Provides a tabbed interface where other modules (Textures, Brushes, Fonts) can register their own tabs. Assets can be dragged and dropped from brows