Livery Editor – Layers / Group
Provides operations on linked-set (group) layers - material propagation to child layers.
Provides operations on linked-set (group) layers - material propagation to child layers.
Overview
ui_liveryEditor_layers_group manages group (linkedSet) layers in the livery editor. It propagates material properties (colour, metallic, roughness, normal intensity) to all child layers in the group.
Extension path: lua/ge/extensions/ui/liveryEditor/layers/group.lua
Exports (M)
| Function | Signature | Description |
|---|---|---|
setColor | (layer, rgbaArray) | Sets the group's colour property and marks it dirty for re-rendering. |
setMetallicIntensity | (layer, metallicIntensity) | Sets metallic intensity on all child layers. |
setRoughnessIntensity | (layer, roughnessIntensity) | Sets roughness intensity on all child layers. |
setNormalIntensity | (layer, normalIntensity) | Sets normal intensity on all child layers. |
getLayerActions | () → string[] | Returns available actions: material, ungroup, lock, delete. |
Internals
Group Actions
Groups support a limited action set compared to decals:
material- colour/metallic/roughness editingungroup- dissolves the group, moves children to the parentlock- toggles layer lockdelete- removes the group and its children
Color via Properties System
Unlike decals which have a direct color field, groups use a properties table with a dirty flag:
M.setColor = function(layer, rgbaArray)
if not layer.properties.color then
layer.properties["color"] = { id = "color", value = rgbaArray }
else
layer.properties["color"].value = rgbaArray
end
layer.propertiesDirty = true
api.setLayer(layer, false) -- commit dirty properties
layer.propertiesDirty = false
api.setLayer(layer, true) -- re-render
endChild Propagation
Metallic, roughness, and normal intensity are set by iterating all layer.children and calling api.setLayer on each:
M.setMetallicIntensity = function(layer, metallicIntensity)
for k, childLayer in ipairs(layer.children) do
childLayer.metallicIntensity = metallicIntensity
api.setLayer(childLayer, true)
end
endHow It Works
- Groups are
linkedSettype layers containing child decal layers - Colour is set via the properties system with a dirty flag cycle
- Material intensities are propagated to each child individually
- The action set is more limited than decals (no transform/mirror/duplicate)
Example Usage
local group = extensions.ui_liveryEditor_layers_group
local api = extensions.editor_api_dynamicDecals
local layer = api.getLayerByUid(groupUid)
group.setColor(layer, {1, 0, 0, 1})
group.setMetallicIntensity(layer, 0.8)Additional Exports
The following exports are available but not yet documented in detail:
M.getLayerActionsM.setNormalIntensityM.setRoughnessIntensity