RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Editor AI TestsEditor AI VisualizationEditor – Assembly Spline ToolAsset BrowserAsset DeduplicatorAsset Management ToolSFX Previewer (Audio Events List)Audio Ribbon EditorAutoSaveBarriers EditorBiome ToolBuilding EditorBulk RenameCamera BookmarksCamera TransformCamera Path EditorCEF HelperCo-Simulation Signal EditorCrawl Data EditorCreate Object ToolDataBlock EditorDecal EditorDecal Spline EditorDocumentation HelperDrag Race EditorDrift Data EditorDrive Path EditorDynamic Decals Tool (Vehicle Livery Creator)Engine Audio DebugExtensions DebugExtensions EditorFFI Pointer Leak TestFile DialogFlowgraph EditorForest EditorForest ViewEditor Gizmo HelperEditor Ground Model Debug HelperEditor Headless Editor TestEditor Icon OverviewEditor ImGui C DemoEditor InspectorEditor Layout ManagerEditor Level SettingsEditor Level ValidatorEditor LoggerEditor Log HelperEditor MainEditor Main MenuEditor Main ToolbarEditor Main UpdateMap Sensor EditorMaster Spline EditorMaterial EditorMeasures Inspector HeaderMesh Editor (Base)Mesh Road EditorMesh Spline EditorMission EditorMission PlaybookMission Start Position EditorMulti Spawn Manager (Vehicle Groups)Navigation Mesh EditorEditor News MessageObject Tool (Object Select Edit Mode)Object To Spline EditorParticle EditorPerformance Profiler / Camera RecorderPhysics ReloaderPrefab Instance EditorEditor PreferencesRace / Path EditorRally EditorRaycast Test Editor ToolRenderer Components Editor ToolRender Test Editor ToolResource Checker Editor ToolRiver EditorRoad Architect EditorRoad DecorationsRoad Editor (Decal Road)Road Network ExporterRoad River Cache HandlerRoad River GUIRoad Spline EditorRoad Template EditorRoad UtilitiesScene TreeScene ViewScreenshot Creator BootstrapScript AI EditorScript AI ManagerSensor Configuration EditorSensor DebuggerShape EditorShortcut LegendSidewalk Spline EditorSites EditorSlot Traffic EditorSuspension Audio DebugTech Server ManagerTerraform ToolTerrain And Road ImporterTerrain EditorTerrain Materials EditorText EditorTool ManagerTool ShortcutsTraffic DebugTraffic ManagerTraffic Signals EditorUndo History ViewerVehicle Bridge TestVehicle Detail ViewerVehicle Editor MainEditor - VisualizationEditor Viz HelperEditor Water Object HelperEditor Windows Manager

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 Extensionseditor

Material Editor

Full-featured material editor for inspecting and modifying Torque3D `Material` objects. Supports PBR workflows, texture issue scanning, cubemap editing, material preview, layer management, copy/paste,

Full-featured material editor for inspecting and modifying Torque3D Material objects. Supports PBR workflows, texture issue scanning, cubemap editing, material preview, layer management, copy/paste, and per-object material picking.


Public API (Extension Hooks)

FunctionSignatureDescription
M.onEditorGui()Main editor GUI callback (tool windows)
M.onEditorInitialized()Registers edit mode, windows, preferences
M.onEditorActivated()Called when editor is activated
M.onEditorDeactivated()Called when editor is deactivated
M.onEditorObjectSelectionChanged()Updates material list on selection change
M.onEditorRegisterPreferences(prefsRegistry)Registers material editor preferences
M.onEditorPreferenceValueChanged(path, value)Handles preference changes
M.onEditorDeleteSelection()Handles delete selection
M.onFilesChanged(files)Reloads on file changes
M.onVehicleSwitched(oid, nid, player)Updates on vehicle switch
M.selectMaterialByName(name)Selects a material by name in the editor
M.showMaterialEditor()Shows the material editor window
M.setMaterialDirty(materialObj)Marks a material as dirty
M.setProperty(matObj, prop, layer, value)Sets a material field and marks dirty
M.deleteMapButton(label, property, layer)UI helper for texture map delete button
M.imageButton(label, property, layer, additionalGuiFn)UI helper for texture image button
M.inputFloat(label, property, float_step, float_step_fast, string_format, layer, tooltip)UI helper for float input
M.colorEdit4(label, property, id, layer, labelSameLine)UI helper for color edit
M.dbg-Debug flag (variable)
M.v-Shared state table (picking, materials, serialization)
M.o-Options table
M.customMaterialsArray-Custom materials array (variable)
M.customMaterialsArrayPtr-Custom materials array pointer (variable)

Key Internal Functions

FunctionDescription
getMaterials(optionalList?)Builds sorted material name list, filters by selection or text
selectMaterialByName(name, clearFilter?)Selects a material in the editor by name
updateMaterialProperties()Updates preview renders and reflection mode for current material
setProperty(matObj, prop, layer, value)Sets a material field and marks dirty
setPropertyWithUndo(prop, layer, value)Sets property with undo history
saveCurrentMaterial()Saves the current material via PersistenceManager
saveAllDirtyMaterials()Saves all modified materials
swapLayersWithUndo(layer1, layer2)Swaps two material layers with undo support
scanTextureIssues(mat)Scans textures for format, path, resolution, and cooker issues
computeTotalTextureSize(mat)Estimates total GPU memory for all textures
computeMaterialUsageForMatName(name)Finds all TSStatic and ForestItemData using a material

Texture Issue Scanner

Checks per-texture-field:

  • Missing files, non-power-of-2 sizes, sizes < 16px
  • Legacy DXT formats vs optimal BC7/BC4/BC5
  • PNG without texture cooker suffix
  • Vehicle material using non-vehicle textures
  • Incorrect format for PBR channels (diffuse=BC7 sRGB, normal=BC5, etc.)

Material Preview

  • ShapePreview instances for inline and extended previews
  • Configurable preview mesh (sphere, cube, etc.)
  • Rotation and sun control

Usage Example

-- Activate via editor menu: Window > Material Editor
-- Pick materials from scene objects or browse the full list
-- Edit PBR properties, textures, animation flags per layer
-- Save individual or all dirty materials

Dependencies

  • ui_imgui for all UI
  • scenetree for Material object lookup
  • PersistenceManager for saving
  • core_environment.groundModels for ground model tags

Module Variables

  • dbg (any) - Module variable.
  • customMaterialsArray (any) - Module variable.
  • customMaterialsArrayPtr (any) - Module variable.

Functions

deleteMapButton(label, property, layer)

Deletes map button.

  • label (string)
  • property (any)
  • layer (object)

imageButton(label, property, layer, additionalGuiFn)

Handles image button.

  • label (string)
  • property (any)
  • layer (object)
  • additionalGuiFn (any)

inputFloat(label, property, float_step, float_step_fast, string_format, layer, tooltip)

Handles input float.

  • label (string)
  • property (any)
  • float_step (any)
  • float_step_fast (any)
  • string_format (any)
  • layer (object)
  • tooltip (any)

colorEdit4(label, property, id, layer, labelSameLine)

Handles color edit4.

  • label (string)
  • property (any)
  • id (number)
  • layer (object)
  • labelSameLine (any)

onFilesChanged(files)

Callback for files changed event.

  • files (any)

onVehicleSwitched(oid, nid, player)

Callback for vehicle switched event.

  • oid (any)
  • nid (any)
  • player (any)

onEditorActivated()

Callback for editor activated event.

onEditorDeactivated()

Callback for editor deactivated event.

showMaterialEditor()

Handles show material editor.

setMaterialDirty(materialObj)

Sets the material dirty.

  • materialObj (any)

onEditorObjectSelectionChanged()

Callback for editor object selection changed event.

onEditorRegisterPreferences(prefsRegistry)

Callback for editor register preferences event.

  • prefsRegistry (any)

onEditorPreferenceValueChanged(path, value)

Callback for editor preference value changed event.

  • path (string)
  • value (any)

onEditorDeleteSelection()

Callback for editor delete selection event.

Returns: self


See Also

  • Editor AI Tests - Related reference
  • Editor AI Visualization - Related reference
  • Editor – Assembly Spline Tool - Related reference
  • World Editor Guide - Guide

Master Spline Editor

Main editor tool for the Master Spline system - a parametric road/spline editor with multi-layer linking (mesh, assembly, decal, road splines), auto banking, terrain conforming, road design homologati

Measures Inspector Header

Lightweight editor extension that displays the bounding box size of the current selection in the inspector header. Shows width × depth × height for single or multi-object selections.

On this page

Public API (Extension Hooks)Key Internal FunctionsTexture Issue ScannerMaterial PreviewUsage ExampleDependenciesModule VariablesFunctionsdeleteMapButton(label, property, layer)imageButton(label, property, layer, additionalGuiFn)inputFloat(label, property, float_step, float_step_fast, string_format, layer, tooltip)colorEdit4(label, property, id, layer, labelSameLine)onFilesChanged(files)onVehicleSwitched(oid, nid, player)onEditorActivated()onEditorDeactivated()showMaterialEditor()setMaterialDirty(materialObj)onEditorObjectSelectionChanged()onEditorRegisterPreferences(prefsRegistry)onEditorPreferenceValueChanged(path, value)onEditorDeleteSelection()See Also