API ReferenceGE Extensionseditor
Terrain Editor
Main terrain editing extension - provides brush-based terrain painting, heightmap manipulation, material management, and terrain block proxy system.
Main terrain editing extension - provides brush-based terrain painting, heightmap manipulation, material management, and terrain block proxy system.
Public API
| Function | Signature | Description |
|---|---|---|
M.onEditorInitialized | () | Registers terrain editor windows, edit modes, and preferences |
M.onEditorDeactivated | () | Cleanup when editor is deactivated |
M.onEditorGui | () | Main terrain editor GUI with brush controls and material panels |
M.onEditorBeforeSaveLevel | () | Saves terrain data before level save |
M.onEditorRegisterPreferences | (prefsRegistry) | Registers terrain editor preferences |
M.onEditorPreferenceValueChanged | (path, value) | Handles preference changes |
M.onEditorObjectAdded | (objectId) | Handles new terrain object addition |
M.onClientEndMission | () | Cleanup on mission end |
M.changeBrushSize | (...) | Changes the terrain brush size |
M.updateTerrainBlockProxies | () | Updates terrain block material proxy list |
M.updateMaterialLibrary | () | Refreshes the material library |
M.getUniqueMtlName | (...) | Generates a unique material name |
M.createMaterialProxy | (...) | Creates a material proxy object |
M.getMtlIdByName | (name) | Returns material ID by name |
M.setMaterialsDirty | () | Marks materials as needing save |
M.setTerrainDirty | () | Marks terrain as needing save |
M.saveMaterials | () | Saves terrain materials to disk |
M.saveTerrainAndMaterials | () | Saves both terrain and materials |
M.copyMaterialProxyWithInputs | (...) | Copies a material proxy with all input maps |
M.setupVars | (...) | Initializes editor variables |
M.dragDropTarget | (...) | Handles drag-drop for material assignment |
M.updatePaintMaterialProxies | () | Updates paint material proxy list |
M.updateMap | (...) | Updates a texture map on a material |
M.removeMap | (...) | Removes a texture map from a material |
M.selectPaintMaterial | (...) | Selects a paint material by proxy |
M.fixGroundmodelName | (...) | Fixes ground model name references |
M.checkForTerrainMaterialFileFormat | () | Checks material file format version |
M.deleteMaterialInJson | (name) | Deletes a material from the JSON file |
M.getTerrainBlockMaterialIndex | (name) | Returns material index on terrain block |
M.getVars | () | Returns the internal variables table |
M.getTerrainEditor | () | Returns the terrain editor C++ object |
M.getTerrainBlock | () | Returns the current terrain block object |
M.getMaterialsInJson | () | Returns materials loaded from JSON |
M.getSelectedPaintMaterialProxy | () | Returns the currently selected paint material proxy |
M.getPaintMaterialProxies | () | Returns all paint material proxies |
M.getTerrainBlockProxies | () | Returns all terrain block proxies |
M.getMatFilePath | () | Returns the material file path |
M.getTerrainFolder | () | Returns the terrain folder path |
M.getErrors | () | Returns current error state table |
M.getLevelPath | () | Returns the level path |
M.fixedFileFormat | () | Clears the deprecated material file format error |
M.beginChangeBrushSizeWithKeys | (direction) | Starts key-based brush size change |
M.endChangeBrushSizeWithKeys | () | Stops key-based brush size change |
Notes
- Core terrain editing extension with extensive material proxy system
- Brush-based painting for heightmap and material layers
- Supports terrain import dialog
- Material file format:
art/terrains/main.materials.json
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Terrain And Road Importer
Editor tool for importing terrain heightmaps and road networks from external data - supports IDW interpolation, peak-based terrain conforming, and DecalRoad generation.
Terrain Materials Editor
Editor window for editing terrain material properties - texture maps, ground model assignment, and material layer configuration.