API ReferenceGE Extensionseditor
Object To Spline Editor
Places copies of a selected object along a DecalRoad or MeshRoad spline with configurable spacing, offsets, and randomization.
Places copies of a selected object along a DecalRoad or MeshRoad spline with configurable spacing, offsets, and randomization.
Overview
An editor tool window that clones a scene object at evenly-spaced intervals along a road spline. Supports terrain alignment, random position/rotation offsets, Gaussian randomization, and undo/redo via the editor history system.
Public Functions
| Function | Signature | Description |
|---|---|---|
M.onEditorGui | () | Renders the tool window UI with parameter controls, preview, and create buttons |
M.onEditorInitialized | () | Registers the window and adds it to the Window menu |
Key Internal Functions
| Function | Description |
|---|---|
createSplineArray(guideId, gap, startOffset, endOffset, params) | Generates position/rotation array along the spline |
createObjects(objId, points, params, presetIds) | Clones objects at computed positions, optionally in a SimGroup |
work(guideId, objId, params, doCreate, keepPoints) | Orchestrates preview or creation workflow |
getRandom(scl, gauss) | Returns centered random value with optional Gaussian distribution |
Parameters
| Parameter | Type | Description |
|---|---|---|
gap | float | Extra spacing between objects |
startOffset / endOffset | float | Distance offset from spline start/end |
useNormal | bool | Align objects to terrain normal |
useSimGroup | bool | Place created objects in a new SimGroup |
objAxis | int | Axis mode: 1=Auto, 2=X, 3=Y, 4=-X, 5=-Y |
allowRandom | bool | Enable random spacing/position/rotation offsets |
objLimit | int | Safety cap on spawned object count |
Usage Example
-- 1. Select an object in the scene (e.g. a fence post)
-- 2. Select a DecalRoad or MeshRoad as the guide spline
-- 3. Set spacing and offsets
-- 4. Click "Preview" to see placement spheres
-- 5. Click "Create" to spawn the objectsNotes
- Supports both
DecalRoadandMeshRoadas guide splines. - Uses
editor.history:commitActionfor full undo/redo support. - Preview renders rainbow-colored debug spheres along the spline.
- Object limit capped at 10,000 maximum regardless of user setting.
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide