Crawl Editor Waypoints
Class-based waypoint/pathnode editor for the Crawl Editor. Manages pathnode selection, gizmo manipulation, segment visualization, and the pathnode detail inspector with custom fields.
Class-based waypoint/pathnode editor for the Crawl Editor. Manages pathnode selection, gizmo manipulation, segment visualization, and the pathnode detail inspector with custom fields.
Constructor
local Waypoints = require('editor/crawlEditor/waypoints')
local wpEditor = Waypoints(crawlEditorRef)Class Methods
| Method | Signature | Description |
|---|---|---|
C:init(crawlEditor) | Initialize with parent editor reference | |
C:setPath(path) | Set the active path (with pathnodes graph) | |
C:selectPathnode(id) | Select pathnode by ID, highlight in viewport | |
C:selectedPathnode() | → node/nil | Returns the currently selected pathnode object |
C:getSelectedPathnodeIndex() | → number | Returns selected pathnode ID |
C:setSelectedPathnodeIndex(idx) | Sets selected pathnode ID | |
C:updateTransform(index) | Sets gizmo transform from pathnode pos/normal | |
C:beginDrag() | Captures pre-drag state for undo | |
C:dragging() | Handles translate/rotate/scale gizmo interaction | |
C:endDragging() | Commits undo action for gizmo manipulation | |
C:handleMouseDown(hovered) | Selects clicked pathnode or clears selection | |
C:createManualPathnode() | Shift-click creates a new pathnode at mouse position | |
C:mouseOverPathnodes() | → node/nil | Finds closest pathnode under mouse ray |
C:drawPathnodeSelectionIndicators() | Debug-draws all pathnodes with highlight/normal/faded modes | |
C:drawPathnodeSegments() | Draws directional prisms between sequential pathnodes | |
C:draw(mouseInfo) | Main draw loop: gizmo update + input | |
C:input() | Processes mouse input, hover, selection, shift-create | |
C:drawPathnodeList(trail) | ImGui list with Add/Remove/Move Up/Move Down buttons | |
C:drawPathnodeDetail(pathnode, index) | Inspector: name, position, radius, recovery flag, custom fields | |
C:drawCustomFields(fields) | Renders custom string/number/vec3 fields with copy/paste |
Gizmo Modes
| Mode | Behavior |
|---|---|
| Translate | Moves pathnode position |
| Rotate | Rotates pathnode normal (local/world alignment) |
| Scale | Changes pathnode radius proportionally |
Custom Fields System
-- Add custom fields to any pathnode
fields:add("myField", "string", "defaultValue")
fields:add("speed", "number", 50)
-- Copy/paste between pathnodesSupports types: string, number, vec3
Notes
- Uses
path.pathnodes.objects(keyed by ID) andpath.pathnodes.sorted(ordered array) - Undo/redo via
editor.history:commitActionwith serialization callbacks - Pathnode draw modes:
highlight(selected),normal,faded(non-pathnode edit mode) - Recovery pathnodes shown with
[Recovery]label in list and tooltips - "Down to Terrain" button snaps pathnode to terrain height
See Also
- Crawl Editor - Boundaries - Related reference
- Crawl Editor Input - Related reference
- Crawl Editor Mission Port Tool - Related reference
- World Editor Guide - Guide
Crawl Editor Trails
Class-based trail editor for the Crawl Editor. Trails are the top-level objects that link paths, boundaries, starting positions, and prefabs together.
Decal Spline Populate
Handles the creation, placement, and removal of decal instances along a decal spline's path. Manages DecalData templates, round-robin/random component distribution, and per-component row/col propagati