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
Layer GroupingMaterial ToolLayer UtilitiesLayer ManagementTransform Tool

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 ExtensionsuiliveryEditortools

Material Tool

Material property tool - sets colour, metallic, roughness, normal intensity, and decal texture on cursor or selected layers.

Material property tool - sets colour, metallic, roughness, normal intensity, and decal texture on cursor or selected layers.


Overview

ui_liveryEditor_tools_material provides the material editing operations (colour, PBR properties, texture swap). It uses doOperation from the tools manager to dispatch to either the cursor, a decal layer, or a group layer depending on context.

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


Exports (M)

FunctionSignatureDescription
setColor(rgbaArray)Sets colour on cursor, decal, or group layer.
setMetallicIntensity(value)Sets metallic intensity (0–1). Validates range.
setRoughnessIntensity(value)Sets roughness intensity (0–1). Validates range.
setNormalIntensity(value)Sets normal intensity (0–1). Groups use roughness setter (bug?).
setDecal(decalTexture)Changes the decal texture on cursor or decal layer.

Internals

Type-Based Dispatch

Each function uses doOperation to route by layer type:

M.setColor = function(rgbaArray)
  uiTools.doOperation(function(layer, color)
    if not layer then
      uiCursorApi.setColor(color)           -- cursor
    elseif layer.type == api.layerTypes.decal then
      uiDecals.setColor(layer, color)       -- decal layer
    elseif layer.type == api.layerTypes.linkedSet then
      uiLayerGroup.setColor(layer, color)   -- group layer
    end
  end, rgbaArray)
end

Target Modules

Layer TypeDelegated To
nil (cursor)ui_liveryEditor_layers_cursor
decalui_liveryEditor_layers_decals
linkedSet / groupui_liveryEditor_layers_group

Validation

Metallic and roughness values are checked for >= 0 or <= 1 (note: the or logic means any non-nil value passes).


How It Works

  1. The UI calls setColor({r, g, b, a}) from the colour picker
  2. doOperation determines whether to target the cursor or selected layers
  3. The appropriate layer-type module handles the actual property change
  4. Each sub-module calls api.setLayer() and notifies the UI

Example Usage

local material = extensions.ui_liveryEditor_tools_material

-- Set colour on whatever is active (cursor or layer)
material.setColor({0.8, 0.2, 0.1, 1})

-- Set PBR properties
material.setMetallicIntensity(0.7)
material.setRoughnessIntensity(0.3)

-- Change texture
material.setDecal("/art/dynamicDecals/racing/number5.png")

Additional Exports

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

  • M.setDecal
  • M.setMetallicIntensity
  • M.setNormalIntensity
  • M.setRoughnessIntensity

See Also

  • Livery Editor – Tools / Group - Related reference
  • Livery Editor – Tools / Misc - Related reference
  • Livery Editor – Tools / Settings - Related reference
  • UI System Guide - Guide

Layer Grouping

Layer ordering and grouping/ungrouping operations for the livery editor.

Layer Utilities

Minimal layer utility - currently only provides layer duplication.

On this page

OverviewExports (M)InternalsType-Based DispatchTarget ModulesValidationHow It WorksExample UsageAdditional ExportsSee Also