API ReferenceGE ExtensionseditortoolUtilities
Editor Tool Utilities – Material Selection Manager
Utility for selecting materials with image thumbnails and a search bar. Used across road/decal tools to pick terrain or decal materials.
Utility for selecting materials with image thumbnails and a search bar. Used across road/decal tools to pick terrain or decal materials.
Public API
| Function | Signature | Description |
|---|---|---|
M.getTexObj | `(absPath) → texture | false |
M.registerWindow | () | Registers the material selection editor window |
M.openWindow | () | Shows the material selection window |
M.closeWindow | () | Hides the material selection window |
M.handleMaterialSelectionSubWindow | (isDecal, onSelectMaterialFunct) | Renders the material selector UI with search filter, image previews, and click callback |
Code Examples
local matMgr = require('editor/toolUtilities/materialSelectionMgr')
-- Register and open the material selection window
matMgr.registerWindow()
matMgr.openWindow()
-- Render the material selection sub-window each frame
-- isDecal=false filters for 'RoadAndPath' tagged materials
-- isDecal=true filters for 'decal' tagged materials
matMgr.handleMaterialSelectionSubWindow(false, function(materialName)
log('I', 'matMgr', 'Selected material: ' .. materialName)
mySpline.material = materialName
matMgr.closeWindow()
end)
-- Get a texture object for preview rendering
local tex = matMgr.getTexObj('/art/terrains/grass_diffuse.dds')
if tex and tex.texId then
im.Image(tex.texId, im.ImVec2(64, 64))
endSee Also
- Tool Utilities - Fit Polyline - Related reference
- Editor Tool Utilities – Geometry - Related reference
- Editor Tool Utilities – Gizmo - Related reference
- World Editor Guide - Guide
Editor Tool Utilities – Gizmo
Utility module for managing the editor axis gizmo (translate/rotate) for spline-editing tools. Handles drag callbacks, undo/redo integration, and local/world alignment switching.
Editor Tool Utilities – Mesh Audition Manager
Utility for previewing and selecting static meshes (DAE files) with a rotating 3D camera audition view and a searchable list window.