Assembly Spline Manager
Central manager for the Assembly Spline tool. Handles spline CRUD operations, undo/redo, presets, serialization, splitting/joining, linking with the Master Spline tool, and dirty-state updates.
Central manager for the Assembly Spline tool. Handles spline CRUD operations, undo/redo, presets, serialization, splitting/joining, linking with the Master Spline tool, and dirty-state updates.
Public Functions
| Function | Description |
|---|---|
M.getToolPrefixStr() | Returns the tool prefix string "Assembly Spline" |
M.getEditModeKey() | Returns the edit mode key for this tool |
M.getAssemblySplines() | Returns the full assembly splines table |
M.getSplineMap() | Returns the id→index lookup map |
M.setAssemblySplines(splines) | Set the full splines table (triggers folder creation) |
M.setAssemblySpline(spline, idx) | Set a single spline at index |
M.getDefaultSliderParams() | Returns default slider parameter values |
M.setPreset(spline, presetStr) | Apply a named preset to a spline |
M.addNewAssemblySpline() | Create a new assembly spline with default wooden fence preset |
M.removeAssemblySpline(idx) | Remove spline at index (deletes meshes and folder) |
M.removeLinkedAssemblySpline(splineId) | Remove a linked spline by ID |
M.removeAllAssemblySplines(isIncludeDisabled) | Remove all (or only enabled/unlinked) splines |
M.splitAssemblySpline(selectedSplineIdx, selectedNodeIdx) | Split a spline into two at the given node |
M.joinAssemblySplines(splineIdx1, nodeIdx1, splineIdx2, nodeIdx2) | Join two splines into one |
M.deepCopyAssemblySpline(spline) | Deep copy a single spline |
M.deepCopyAssemblySplineState() | Deep copy all splines (for undo/redo snapshots) |
M.copyAssemblySplineProfile(spline) | Copy spline profile (parameters only, no geometry) |
M.pasteAssemblySplineProfile(spline, profile) | Paste a profile onto a spline |
M.singleSplineEditUndo(data) | Undo callback for single-spline edits |
M.singleSplineEditRedo(data) | Redo callback for single-spline edits |
M.transSplineEditUndo(data) | Undo callback for trans-spline edits |
M.transSplineEditRedo(data) | Redo callback for trans-spline edits |
M.objectSelectUndo(data) | Undo callback for object selection |
M.objectSelectRedo(data) | Redo callback for object selection |
M.updateDirtyAssemblySplines() | Recompute geometry and repopulate dirty splines |
M.convertPathsToAssemblySplines(paths) | Convert bitmap-traced paths to assembly splines |
M.serializeAssemblySpline(spline) | Serialize a spline to a buffer-encoded string |
M.deserializeAssemblySpline(data, isCreateObject) | Deserialize a spline from encoded data |
M.getCurrentAssemblySplineList() | Get list of enabled splines {name, id, type} |
M.isLinked(id) | Check if a spline is linked to a master spline |
M.setLink(id, groupId, isLink) | Set/unset linking for a spline |
M.updateLinkedAssemblySpline(id, points, widths, nmls, isLoop, isConformToTerrain) | Update linked spline geometry from master |
M.unlinkAll() | Unlink all assembly splines |
Built-in Presets
| Preset Key | Name | Kit Path |
|---|---|---|
wooden_fence | Wooden Fence | assets/meshes/props/assembly_kit/ak_wood_fence_001/ |
telegraph_pole | Telegraph Pole | assets/meshes/props/assembly_kit/ak_wood_pole_old_001/ |
metal_crash_barrier | Metal Crash Barrier | assets/meshes/props/assembly_kit/ak_guardrail_001/ |
Spline Data Structure
local spline = {
name = "Assembly Spline 1",
id = "<uuid>",
isLoop = false,
sceneTreeFolderId = <int>,
isDirty = false,
isEnabled = true,
isLink = false,
linkId = nil,
nodes = {}, -- vec3 control points
widths = {}, -- per-node widths
nmls = {}, -- per-node normals
spacing = 0.0, -- extra spacing between molecules
verticalOffset = 0.0,
normalMode = 2, -- 0=local, 1=global, 2=terrain
sag = 0.0, -- bridge sag factor
preRot = 0, -- pre-rotation index (0/1/2/3 = 0°/90°/180°/270°)
kitFolderPath = "...",
meshKit = {},
moleculeDescription = {},
}Functions
setPreset(spline, presetStr)
Sets the preset.
spline(object)presetStr(any)
Returns: -- No spline or preset string provided.
singleSplineEditUndo(assemblySplineData)
Handles single spline edit undo.
assemblySplineData(any)
singleSplineEditRedo(assemblySplineData)
Handles single spline edit redo.
assemblySplineData(any)
transSplineEditUndo(data)
Handles trans spline edit undo.
data(table)
transSplineEditRedo(data)
Handles trans spline edit redo.
data(table)
objectSelectUndo(data)
Handles object select undo.
data(table)
objectSelectRedo(data)
Handles object select redo.
data(table)
Returns: self
unlinkAll()
Handles unlink all.
Returns: self
See Also
- assemblySpline/molecule - Molecule building and attachment logic
- assemblySpline/populate - Mesh placement along splines
Assembly Spline Populate
Handles the placement of molecule instances (rigid + bridge meshes) along an assembly spline. Manages mesh pooling, spline sampling, rigid placement via attachment sequences, and bridge scaling/alignm
Crawl Editor - Boundaries
Sub-module of the Crawl Data Editor handling boundary polygon creation and editing. Provides vertex manipulation with gizmo support, terrain snapping, and undo/redo history.