Mesh Editor (Base)
Shared base module for MeshRoad and River editors. Provides node selection, gizmo-based manipulation, width/depth editing, copy/paste of mesh fields, and undo/redo for all node operations. Not used di
Shared base module for MeshRoad and River editors. Provides node selection, gizmo-based manipulation, width/depth editing, copy/paste of mesh fields, and undo/redo for all node operations. Not used directly - consumed by meshRoadEditor and riverEditor.
Public API (Exposed via M)
| Function | Signature | Description |
|---|---|---|
M.onUpdate_ | () | Per-frame update: rendering, input handling, gizmo |
M.onToolbar_ | () | Toolbar UI with default width/depth sliders |
M.onActivate_ | () | Activates the edit mode for the current mesh type |
M.onEditorInspectorHeaderGui_ | (info) | Inspector header customization |
M.onEditorRegisterPreferences_ | (reg) | Registers width/depth/height preferences |
M.onEditorPreferenceValueChanged_ | (path, val) | Handles preference changes |
M.onEditorInspectorFieldChanged_ | (ids, field, val, idx) | Triggers mesh regeneration |
M.onEditorAxisGizmoAligmentChanged_ | () | Updates gizmo position on alignment change |
M.onEditorObjectSelectionChanged_ | () | Updates selected mesh reference |
M.copySettingsAM | () | Copies current mesh fields |
M.pasteFieldsAM | () | Pastes copied fields with undo |
M.onDeleteSelection | () | Deletes selected node(s) or mesh |
M.onSelectAll | () | Selects all nodes in current mesh |
Node Operations (with Undo)
| Function | Description |
|---|---|
setAllNodesWidthAction | Sets all node widths to a value |
setAllNodesDepthAction | Sets all node depths to a value |
setAllNodesNormalAction | Resets all normals to up vector |
deleteNode | Deletes a single node |
insertNode | Inserts a node between two existing nodes |
Configuration
| Preference | Default | Description |
|---|---|---|
defaultWidth | 10 | Default width for new nodes |
defaultDepth | 5 | Default depth for new nodes |
defaultHeight | 2 | Height offset for placement |
dragWidth | false | Enable drag-to-set-width on creation |
Usage Example
-- This is a base module; use via meshRoadEditor or riverEditor
local meshEditor = dofile("/lua/ge/extensions/editor/meshEditor.lua")
meshEditor.type = "MeshRoad"
meshEditor.preferencesName = "meshRoadEditor"Dependencies
editor_roadRiverGui- Shared road/river renderingui_imgui
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Measures Inspector Header
Lightweight editor extension that displays the bounding box size of the current selection in the inspector header. Shows width × depth × height for single or multi-object selections.
Mesh Road Editor
Editor extension for creating and editing MeshRoad objects. Thin wrapper around the shared `meshEditor` base module, configured for MeshRoad-specific behavior.