Editor Main Update
Core per-frame update loop for the editor. Drives edit mode updates, object icon rendering, preference broadcasting, gizmo rendering, GUI presentation, and collision rebuild checks.
Core per-frame update loop for the editor. Drives edit mode updates, object icon rendering, preference broadcasting, gizmo rendering, GUI presentation, and collision rebuild checks.
Module Overview
| Aspect | Detail |
|---|---|
| File | extensions/editor/mainUpdate.lua |
| Returns | M table |
| Role | Editor frame update orchestration |
Public Functions
| Function | Signature | Description |
|---|---|---|
M.onUpdate | (dtReal, dtSim, dtRaw) | Main per-frame update - only runs when editor.active is true |
M.onExtensionLoaded | () | Extension load hook (no-op) |
M.onExtensionUnloaded | () | Extension unload hook (no-op) |
Update Pipeline (per frame)
1. editor.updateObjectIcons() -- Update icon positions/visibility
2. preferencesRegistry:broadcastPreferenceValueChanged()
└── editor.savePreferences() -- Auto-save if any pref changed
3. editor.editMode.onUpdate(dt...) -- Active edit mode update
4. drawMainEditorGizmos() -- Object icons (if not hidden)
5. editor.guiModule.presentGui(dt...) -- ImGui presentation
6. editor.valueInspectorCopyPasteMenu()
7. editor.valueInspectorFilenameContextMenu()
8. editor.modalDialogWindowUi()
9. editor.saveDirtyToolsUi()
10. editor.rebuildCollision() -- If flaggedUsage Context
This module is loaded as editor_mainUpdate and its onUpdate is called by the engine's main loop. It coordinates all editor subsystems each frame.
-- The update only fires when the editor is active
if editor.active then
-- All editor per-frame work happens here
endNote:
M.onEditorInitializedis explicitly set tonil, indicating this module has no initialization needs - it relies oneditor_mainfor setup.
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Editor Main Toolbar
Renders the editor's main toolbar with edit mode buttons, transform snapping controls (grid/rotation/scale), camera speed slider, time-of-day slider, terrain snap settings, and configurable edit mode
Map Sensor Editor
Editor tool for placing and configuring map-attached sensors (Camera, LiDAR, Ultrasonic, RADAR). Requires `Research` build flag. Provides full ImGui UI for sensor management, live/edit mode toggling,