API ReferenceGE Extensionseditor
DataBlock Editor
Editor window for browsing, creating, deleting, and saving SimDataBlock objects. Provides a two-tab interface (Existing/New) with inspector integration.
Editor window for browsing, creating, deleting, and saving SimDataBlock objects. Provides a two-tab interface (Existing/New) with inspector integration.
Public API
| Function | Signature | Description |
|---|---|---|
M.onEditorInitialized() | Registers window and menu item | |
M.onEditorGui() | Renders the DataBlock Editor and Create DataBlock windows | |
M.onEditorInspectorFieldChanged(ids, field, value, idx) | Marks edited datablocks as dirty | |
M.onExtensionLoaded() | Logs initialization |
Window Features
Existing Tab
- Tree view of all datablocks grouped by class name
- Click to select and inspect in the property inspector
- Dirty indicators (asterisk
*) on modified datablocks - Save button: saves selected datablock to its file
- Delete button: removes datablock from file (with undo support)
New Tab
- Lists all SimDataBlock-derived class names
- Click a class to open the Create DataBlock dialog
- Create dialog: name input, optional "copy values from" combo, Create button
Undo/Redo Actions
| Action | Description |
|---|---|
CreateDataBlock | Creates a new datablock, optionally copies fields from existing |
DeleteDataBlock | Removes datablock from its file (persists deletion on next save) |
Usage Example
-- Open the DataBlock Editor from code
editor.showWindow("dataBlockEditor")
-- Programmatically create a datablock
local id = editor.createDataBlock("MyNewDB", "SFXDescription")
editor.selectObjectById(id)Internal Functions
| Function | Description |
|---|---|
getAllDataBlockClasses() | Enumerates all SimDataBlock subclasses and their instances |
isDataBlock(objectID) | Checks if an object ID belongs to the DataBlockSet |
Notes
- Uses
Sim.getDataBlockSet()to enumerate all registered datablocks - Dirty tracking via
editor.isDataBlockDirty()/editor.setDataBlockDirty() - Save uses
editor.saveDataBlockToFile()for individual andeditor.saveDirtyDataBlock()for batch - Delete removes from file but object persists in memory until restart
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Create Object Tool
Editor tool for creating scene objects via toolbar groups. Provides categorized buttons (Environment, Level, BeamNG, Other Classes) with click-to-place creation, build functions for default field setu
Decal Editor
Full-featured decal placement and editing tool. Manages DecalData templates and decal instances with multi-selection, gizmo manipulation (translate/rotate/scale), spatial grid acceleration, and debug