RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
ui/ambientSound - Ambient Sound Stream PlayerUI Apps ManagerUI AudioBindings LegendCamera Distance AppConsole (consoleNG)Credits MusicExternal App (WebSocket UI Server)Fade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsUI Navigation / MapVehicle Paint EditorVehicle Vicinity AppUI Visibility

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsui

Livery Editor

Main livery editor controller - manages setup, teardown, saving, and update loop for the dynamic decal painting system.

Main livery editor controller - manages setup, teardown, saving, and update loop for the dynamic decal painting system.


Overview

ui_liveryEditor is the top-level controller for the vehicle livery/painting system. It initializes the dynamic decals API, manages the editor lifecycle (setup → edit → save → deactivate), and provides the main update loop.

Extension path: lua/ge/extensions/ui/liveryEditor.lua

Dependencies: editor_api_dynamicDecals, ui_liveryEditor_resources


Exports (M)

Function/FieldSignatureDescription
setup(liveryPath?)Initializes the editor, optionally loading a saved livery.
deactivate()Tears down the editor and restores vehicle controls.
save(filename)Exports the current livery skin and creates a save file.
setDecalTexture(texturePath)Sets the active decal color texture.
useSurfaceNormal(enable)Toggles surface-normal-aligned decal projection.
useMousePosition(enable)Toggles mouse-position-based decal placement.
onUpdate(dtReal, dtSim, dtRaw)Frame update - runs API update and handles save loading.
requestSettingsData()Sends current settings to UI via guihook.

State Fields

FieldDescription
M.isRunningTrue while the editor is active.
M.initializedTrue after first setup.
M.saveNameCurrent save filename.
M.savePathPath to loaded livery.
M.saveLoadedTrue after livery data has been loaded.
M.isAddingLayerTrue during layer addition mode.
M.dependencies{"editor_api_dynamicDecals", "ui_liveryEditor_resources"} - decal API and resources.

Internals

Setup Flow

M.setup = function(liveryPath)
  api.setLayerNameBuildString("@type { - @colormap}")
  api.setup()
  core_vehicle_partmgmt.setSkin("dynamicTextures")
  extensions.editor_dynamicDecalsTool.doApiUpdate = false
  api.setEnabled(true)
  -- Initialize all ui_liveryEditor_* sub-modules
  -- Disable vehicle controls
  toggleVehicleControls(false)
  M.useSurfaceNormal(true)
  showDecalCursor(false)
  guihooks.trigger("liveryEditor_SetupSuccess", {initialized})
end

Save/Load

-- Save current work
M.save = function(filename)
  api.exportSkin(vehicleObj.jbeam, filename)
  uiUserDataApi.createSaveFile(filename)
end

-- Load is deferred by saveLoadWaitTime (1 second)
-- to ensure the dynamic texture skin is ready

Deactivation

Restores the vehicle to the saved skin, clears the layer stack, re-enables vehicle controls, and resets all state.

Update Loop

The onUpdate function runs every frame while active:

  1. Decrements saveLoadWaitTime
  2. Calls api.onUpdate_() to process decal rendering
  3. After wait expires, loads the saved livery (if any)

Vehicle Control Toggle

local function toggleVehicleControls(enable)
  scenetree.findObject("VehicleCommonActionMap"):setEnabled(enable)
  scenetree.findObject("VehicleSpecificActionMap"):setEnabled(enable)
end

How It Works

  1. UI opens livery editor → calls M.setup(liveryPath)
  2. Dynamic decals API is initialized and vehicle skin set to "dynamicTextures"
  3. Sub-modules (camera, controls, layers) are initialized
  4. After 1-second delay, existing livery is loaded or new one started
  5. User edits decals/layers through sub-module APIs
  6. M.save(filename) exports the skin; M.deactivate() cleans up

Additional Exports

The following exports are available but not yet documented in detail:

  • M.onUpdate
  • M.requestSettingsData
  • M.saveLoadWaitTime
  • M.setDecalTexture
  • M.useMousePosition

Grid Selector

Facade module that routes all grid selector API calls to the appropriate backend (vehicle, gameplay, app, freeroam).

Messages Debugger

ImGui debug window for composing, sending, and clearing UI message events.

On this page

OverviewExports (M)State FieldsInternalsSetup FlowSave/LoadDeactivationUpdate LoopVehicle Control ToggleHow It WorksAdditional Exports