Editor Viz Helper
Provides an in-editor visual helper tool for level designers to place temporary decal markers on surfaces. Uses dynamic decals from `art/vizhelper/` with mouse-driven placement, rotation, and scaling
Provides an in-editor visual helper tool for level designers to place temporary decal markers on surfaces. Uses dynamic decals from art/vizhelper/ with mouse-driven placement, rotation, and scaling controls.
Public Interface
Variables
| Variable | Type | Description |
|---|---|---|
M.openWindow | function | Opens the Viz Helper ImGui window by setting windowOpen[0] = true. |
M.windowOpen | im.BoolPtr | Shared pointer controlling window visibility; can be toggled externally. |
Editor Hooks
| Hook | Description |
|---|---|
M.onEditorGui | Draws the Viz Helper window: preview decal on mouse cursor, options panel (image, size, rotation, color), click-to-place decals, keyboard/mouse wheel shortcuts. |
M.onEditorInitialized | Registers the "Viz Helper" window menu item under the Debug group. |
M.onEditorActivated | Called when the editor is activated (no-op placeholder). |
M.onEditorDeactivated | Clears all saved decals when the editor is deactivated. |
M.onExtensionLoaded | Scans art/vizhelper/ for image files, builds the combo-box string list. |
M.onUpdate | Renders all saved decals each frame via Engine.Render.DynamicDecalMgr.addDecals. |
M.onDeserialized | Restores the windowOpen state from serialized data. |
M.onSerialize | Saves the current windowOpen state for persistence across editor sessions. |
Internal State
| Local | Type | Purpose |
|---|---|---|
savedDecals | table | Array of placed decal data tables rendered each frame. |
vizHelper | table | List of available decal image filenames from art/vizhelper/. |
scale | im.FloatPtr | Current decal size (default 20). |
rotation | im.FloatPtr | Current decal rotation in degrees (default 0). |
minDistance | im.FloatPtr | Minimum cursor travel distance before placing a new decal during drag. |
color | im.ArrayFloat | RGBA color tint applied to decals. |
Mouse/Keyboard Controls
| Input | Action |
|---|---|
| MouseWheel | Rotate decal |
| Ctrl + MouseWheel | Scale decal |
| Alt + MouseWheel | Cycle through images |
| Shift | Increase mouse wheel sensitivity 10× |
| Left Click / Drag | Place decal(s) at cursor position |
Usage Example
-- Open the Viz Helper window from another editor extension
local vizHelper = extensions.editor_vizHelper
vizHelper.openWindow()
-- Check if window is currently open
if vizHelper.windowOpen[0] then
log('I', 'myExt', 'Viz Helper is open')
endDecal Data Structure
-- Each entry in savedDecals has this shape:
local data = {
texture = "art/vizhelper/arrow.png",
position = vec3(100, 200, 50),
color = ColorF(1, 0, 0, 1),
forwardVec = vec3(0.707, 0.707, 0), -- rotated perpendicular to surface normal
scale = vec3(20, 20, 20),
fadeStart = 2000,
fadeEnd = 2500,
normal = vec3(0, 0, 1),
}
Engine.Render.DynamicDecalMgr.addDecal(data)Serialization
-- onSerialize returns:
{ windowOpen = true } -- or false
-- onDeserialized receives same table, restores window stateSee Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Editor - Visualization
Central visualization management tool for the BeamNG editor, providing toggles for debug rendering modes, object visibility/selectability, material debug overlays with legends, and navgraph visualizat
Editor Water Object Helper
Automatically reloads textures on WaterObject instances when texture-related inspector fields are changed in the editor.