Dynamic Decals Vehicle Color Palette
Editor module providing the Vehicle Color Palette section for the Dynamic Decals tool. Allows editing the three vehicle color slots (color, colorPalette0, colorPalette1) with metallic paint data, rand
Editor module providing the Vehicle Color Palette section for the Dynamic Decals tool. Allows editing the three vehicle color slots (color, colorPalette0, colorPalette1) with metallic paint data, randomization from presets, save/load palettes, and color swapping.
Module Info
| Key | Value |
|---|---|
| File | extensions/editor/dynamicDecals/vehicleColorPalette.lua |
| logTag | editor_dynamicDecals_vehicleColorPalette |
| Dependencies | editor_api_dynamicDecals, editor_dynamicDecals_docs |
Public API
| Function | Signature | Description |
|---|---|---|
M.onGui | (guiId) | Renders the full vehicle color palette GUI |
M.onSerialize | () → table | Saves current vehicle colors for session persistence |
M.onDeserialized | (data) | Restores vehicle colors (with 5-frame delay for vehicle readiness) |
M.registerEditorPreferences | (prefsRegistry) | Registers vehicleColorPalette.palettes preference with extensive default palette collection |
M.editorPreferenceValueChanged | (path, value) | Stub |
M.setup | (tool_in) | Registers "Vehicle Color Palette" section (priority 120), update function, and docs |
Features
| Feature | Description |
|---|---|
| 3 Color Slots | Each with color picker, randomize button, metallic paint controls (metallic, roughness, clear coat, clear coat roughness) |
| Color Swapping | Arrow buttons to swap colors between adjacent palette slots |
| Randomize All | Picks 3 unique random colors from preset table |
| Save/Load | Named palette presets stored in editor preferences |
| Preferences GUI | Custom preference renderer with inline load/delete/rename for each saved palette |
Default Palettes
19 built-in palettes including: BeamNG, Camouflage, Chocolate, Dunes, Fast Car, France, Icy, Italy, Lilac, Midnight, Moss, Neptune, Pastelle, Retro Handheld Console, Sunset, Tape Deck, The 80's, Vintage, Watermelon.
Metallic Paint Data
Each color slot exposes 4 float sliders (0–1):
- Metallic - metallic intensity
- Roughness - surface roughness
- Clear Coat - clear coat intensity
- Clear Coat Roughness - clear coat roughness
Stored via vehicleObj:setField('metallicPaintData', slotId, value).
Usage Example
-- Vehicle colors are set directly on the vehicle object:
local vehicleObj = getPlayerVehicle(0)
vehicleObj.color = Point4F(1, 0, 0, 1) -- Red
vehicleObj.colorPalette0 = Point4F(0, 0, 0, 1) -- Black
vehicleObj.colorPalette1 = Point4F(1, 1, 1, 1) -- WhiteSee Also
- Dynamic Decals - Browser - Related reference
- Dynamic Decals - Brushes - Related reference
- Dynamic Decals - Camera - Related reference
- World Editor Guide - Guide
Dynamic Decals Textures
Editor module providing the texture browser, tag browser, texture inspector, and sidecar metadata management for the Dynamic Decals tool. Handles texture selection, context menus, drag-drop, virtual s
Dynamic Decals Widgets
Editor module providing the unified property widget rendering system for the Dynamic Decals tool. Maps API property types to appropriate ImGui controls (sliders, inputs, combos, color pickers, texture