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

Layer Grouping

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

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


Overview

ui_liveryEditor_tools_group manages layer stack ordering (move up/down/top/bottom) and group creation/dissolution. It operates on the currently selected layer(s) via the selection API.

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


Exports (M)

FunctionSignatureDescription
moveOrderUp() → newOrderMoves the selected layer one position up in the stack.
moveOrderDown() → newOrderMoves the selected layer one position down.
changeOrderToTop() → newOrderMoves the selected layer to the top of its siblings.
changeOrderToBottom() → newOrderMoves the selected layer to position 2 (above the fill base).
setOrder(order) → resultSets the selected layer to an explicit order position.
moveOrderUpById(layerUid) → newOrderMoves a specific layer up by UID.
moveOrderDownById(layerUid) → newOrderMoves a specific layer down by UID.
changeOrder(oldOrder, oldParentUid, newOrder, newParentUid)Low-level order change with parent support.
groupLayers()Groups all selected layers into a new linked set.
ungroupLayer()Dissolves a group, moving children to the group's parent.

Internals

Order Bounds

  • Top = siblingCount (highest order)
  • Bottom = 2 (position 1 is typically the fill base layer)
  • Moving up increments order; moving down decrements

Group Creation

M.groupLayers = function()
  -- Find shallowest selected layer to determine parent
  local shallowestLevel, parentUid = ...
  local newGroup = api.addLinkedSet({parentUid})

  -- Move each selected layer into the new group
  for k, layerUid in ipairs(selectedLayerUids) do
    api.moveLayer(uiLayer.order, uiLayer.parentUid, newOrder, newGroup.uid)
  end

  uiSelectionApi.select(newGroup.uid)
end

Ungroup Flow

  1. Stores child UIDs (to avoid stale references during moves)
  2. Moves each child from the group to the group's parent at sequential positions
  3. Removes the now-empty group layer

How It Works

  1. Order operations use api.moveLayer(from, fromParent, to, toParent) to reposition
  2. Group creation uses api.addLinkedSet() then moves selected layers into it
  3. Ungrouping iterates children, moves them out, then deletes the group shell
  4. The selection automatically updates to the newly created group

Example Usage

local groupTool = extensions.ui_liveryEditor_tools_group

-- Move selected layer up
groupTool.moveOrderUp()

-- Group multiple selected layers
extensions.ui_liveryEditor_selection.select({uid1, uid2})
groupTool.groupLayers()

-- Ungroup
groupTool.ungroupLayer()

Additional Exports

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

  • M.changeOrder
  • M.changeOrderToBottom
  • M.changeOrderToTop
  • M.moveOrderDown
  • M.moveOrderDownById
  • M.moveOrderUp
  • M.moveOrderUpById
  • M.setOrder
  • M.ungroupLayer

See Also

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

Group Layers

Provides operations on linked-set (group) layers - material propagation to child layers.

Material Tool

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

On this page

OverviewExports (M)InternalsOrder BoundsGroup CreationUngroup FlowHow It WorksExample UsageAdditional ExportsSee Also