Dynamic Decals Tool (Vehicle Livery Creator)
Editor extension providing the Vehicle Livery Creator - a comprehensive tool for painting decals, brush strokes, paths, and fills onto vehicle surfaces in real-time.
Editor extension providing the Vehicle Livery Creator - a comprehensive tool for painting decals, brush strokes, paths, and fills onto vehicle surfaces in real-time.
Overview
editor_dynamicDecalsTool is the main orchestrator for the dynamic decals system. It registers an editor edit mode, manages tool sections (collapsible UI panels), toolbar items, and coordinates dozens of sub-modules (textures, brushes, layers, gizmo, camera, etc.). The tool supports decal, brush stroke, and path placement modes.
Module Fields
| Field | Type | Description |
|---|---|---|
M.version | table | Semantic version {1,1,0} |
M.dependencies | table | List of ~35 sub-extension dependencies |
M.toolModes | table | Enum: none=0, decal=1, brushStroke=2, path=3 |
M.toolMode | number | Currently active tool mode |
M.doApiUpdate | bool | Whether to call api.onUpdate_() each frame |
M.directoryPath | string | Base asset path "/art/dynamicDecals/" |
Public Functions
| Function | Description |
|---|---|
M.registerSection(name, guiFn, order, defaultOpen, window, buttons) | Register a collapsible UI section in the tool window |
M.setSectionOpenState(name, newState, setScroll) | Open/close a section by name, optionally scroll to it |
M.getSectionOpenState(name) | Returns whether a section is currently open |
M.getSectionWindowName(section) | Returns the formatted window name for a section |
M.registerToolbarToolItem(name, guiFn, order) | Add a tool button to the toolbar |
M.registerToolbarActionItem(name, guiFn, order) | Add an action button to the toolbar |
M.registerEditorOnUpdateFn(name, onUpdateFn) | Register a per-frame update callback |
M.unregisterEditorOnUpdateFn(name) | Remove a per-frame update callback |
M.registerOnEditorGuiFn(name, guiFn) | Register an additional GUI draw function |
M.unregisterOnEditorGuiFn(name) | Remove an additional GUI draw function |
M.applyDecal(value) | Apply decal/brush/path based on current tool mode (value=1 press, 0 release) |
M.changeDecalSize(increase, mod) | Adjust decal scale by preference step |
M.changeDecalRotation(clockwise, mod) | Adjust decal rotation by preference step |
M.undo() / M.redo() | Undo/redo layer operations |
M.lockDepth(value) | Lock/unlock depth buffer |
M.lockSurfaceNormal(value) | Lock/unlock surface normal |
M.enableBrushStroke(value) | Enable/disable brush stroke recording |
M.enablePathLayer(value) | Enable/disable path layer mode |
M.finishPathLayer() | Finalize the current path layer |
M.setCurrentMaskEditingLayerUid(uid) | Set the layer UID for mask editing |
M.getCurrentMaskEditingLayerUid() | Get the current mask editing layer UID |
M.removeLastPathLayerPoint() | Remove the last point from the current path layer |
M.getIconSize() | Returns the icon size number |
M.getIconSizeVec2() | Returns the icon size as ImVec2 |
M.getMainScrollY() | Returns the main window scroll Y position |
M.dynamicDecals_onLayerUpdated(layerUid) | Hook called when a dynamic decal layer is updated |
M.dynamicDecals_moveLayer(from, fromParentUid, to, toParentUid) | Hook called when a layer is moved in the stack |
Editor Hooks
| Hook | Purpose |
|---|---|
M.onEditorInitialized | Sets up API, windows, edit mode, dependencies, sections |
M.onEditorGui | Draws main tool window and all section windows |
M.onEditorToolWindowShow | Activates edit mode, sets dynamic textures skin |
M.onEditorToolWindowHide | Returns to object select mode, hides sub-windows |
M.onEditorRegisterPreferences | Registers dynamicDecalsTool.general.* preferences |
M.onEditorPreferenceValueChanged | Propagates preference changes to sub-modules |
M.onVehicleSwitched | Updates materials via settings module |
M.onEditorActivated | Re-initializes on editor activation |
M.onEditorDeactivated | Cleanup on editor deactivation |
M.onEditorSaveState | Saves tool state |
M.onEditorLoadState | Restores tool state |
M.onSerialize | Serializes decal tool state for persistence |
M.onDeserialized | Restores decal tool state from serialized data |
Usage Example
-- Register a custom section in the decals tool
extensions.editor_dynamicDecalsTool.registerSection(
"My Section",
function(id) imgui.Text("Custom content") end,
50, -- order
true, -- default open
{ size = imgui.ImVec2(300, 200) } -- external window
)
-- Change tool mode
local M = extensions.editor_dynamicDecalsTool
M.toolMode = M.toolModes.brushStrokeSee Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Drive Path Editor
Main editor tool for creating and managing AI drive path splines. Supports **Free Mode** (arbitrary nodes on terrain) and **NavGraph Mode** (waypoint-to-waypoint paths on the navigation graph). Featur
Engine Audio Debug
Editor window for real-time tweaking of engine sound parameters including gain, EQ, muffling, and frequency settings with live preview and clipboard export.