RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Ambient SoundUI Apps ManagerUI AudioBindings LegendCamera Distance AppDeveloper ConsoleCredits MusicExternal WebSocket ServerFade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsNavigation Map DataVehicle Paint EditorVehicle Vicinity AppUI Visibility
Camera ManagementAction Map ManagementEdit Mode State MachineLivery EditorUndo/Redo WrapperLayer ActionsLayer Edit LifecycleLayer DataDecal Texture LoaderLayer SelectionToolsLivery FilesMath Utilities

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 ExtensionsuiliveryEditor

Layer Actions

Dispatches high-level actions (reproject, transform, delete, duplicate, mirror, etc.) on the currently selected layer(s).

Dispatches high-level actions (reproject, transform, delete, duplicate, mirror, etc.) on the currently selected layer(s).


Overview

ui_liveryEditor_layerAction defines an action-dispatch system for the livery editor. The UI sends an action string and this module routes it to the appropriate operation on the selected layer.

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


Exports (M)

FunctionSignatureDescription
performAction(action) → variesDispatches the named action on the current selection. Returns action-specific data.
toggleEnabledByLayerUid(layerUid)Toggles a layer's enabled flag directly by UID.

Action Types

ActionDescription
requestReprojectShows the cursor with the selected layer's properties for repositioning.
cancelReprojectRestores the layer and hides the cursor.
reprojectStamps the cursor position as the new layer position.
transformOpens the layer transform view for position/scale/rotation editing.
materialsOpens the materials view for colour/metallic/roughness editing.
highlightToggles decal highlighting on the selected layer. Returns bool.
enabledToggles enabled state on all selected layers. Returns bool.
deleteRemoves the selected layer from the stack.
duplicateDuplicates the selected layer.
mirrorToggles the mirrored flag. Returns bool.
flipMirroredToggles flip on the mirrored decal. Returns bool.

Internals

Reproject Flow

  1. requestReproject - copies layer properties to the cursor, hides the layer, shows the cursor
  2. User repositions the cursor on the vehicle
  3. reproject - stamps a new decal, overwrites the original layer UID, removes the temporary

Mouse vs Cursor

Helper functions useMouse() / useCursor() toggle api.settingsFlags.UseMousePos to switch between mouse-driven and keyboard/controller-driven cursor placement.


How It Works

  1. The UI calls performAction("transform") (or any action string)
  2. The module reads the first selected layer from ui_liveryEditor_selection
  3. Fetches the full layer data from the API
  4. Routes to the corresponding internal function
  5. Returns a value where applicable (booleans for toggles)

Example Usage

local layerAction = extensions.ui_liveryEditor_layerAction

-- Delete the selected layer
layerAction.performAction("delete")

-- Toggle mirror and check result
local mirrored = layerAction.performAction("mirror")

-- Toggle enabled directly
layerAction.toggleEnabledByLayerUid(someLayerUid)

Additional Exports

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

  • M.performAction
  • M.toggleEnabledByLayerUid

See Also

  • Livery Editor - Camera - Related reference
  • Livery Editor - Controls - Related reference
  • Livery Editor - Edit Mode - Related reference
  • UI System Guide - Guide

Undo/Redo Wrapper

Thin wrapper around the dynamic decals API undo/redo system that notifies the UI on history changes.

Layer Edit Lifecycle

Manages the full edit lifecycle for a single decal layer - transform (translate, rotate, scale, skew), material properties, and gamepad/controller hold-repeat input.

On this page

OverviewExports (M)Action TypesInternalsReproject FlowMouse vs CursorHow It WorksExample UsageAdditional ExportsSee Also