API ReferenceGE Extensionseditor
Shape Editor
Interactive 3D shape viewer and editor - supports detail level inspection, render flag toggling, node hierarchy viewing, material highlighting, LOD generation, sequence animation, and Collada/Wavefron
Interactive 3D shape viewer and editor - supports detail level inspection, render flag toggling, node hierarchy viewing, material highlighting, LOD generation, sequence animation, and Collada/Wavefront export.
Public API
| Function | Signature | Description |
|---|---|---|
M.onEditorGui | () | Main GUI - shape preview with tabbed panels |
M.onEditorInitialized | () | Registers Shape Editor window and menu item |
M.showShapeEditorLoadFile | (filename) | Loads a shape file into the editor for viewing |
M.onEditorInspectorHeaderGui | (inspectorInfo) | Adds "Open in Shape Editor" button to TSStatic inspector |
M.onEditorObjectSelectionChanged | () | Auto-loads selected TSStatic if preference enabled |
M.onEditorRegisterPreferences | (prefsRegistry) | Registers shapeEditor.general.autoOpenSelectedObject |
M.onEditorExitLevel | () | Clears the loaded shape |
M.onEditorDeactivated | () | Restores materials and cleans up temp objects |
M.onSerialize / M.onDeserialized | () / (data) | Persistence of loaded mesh file |
Editor Tabs
| Tab | Features |
|---|---|
| Details | Force detail level, export to Collada/Wavefront, shape stats (polys, materials, draw calls, bones, collision meshes) |
| Render | Toggle Ghost, Nodes, Bounds, ObjBox, ColMeshes, Wireframe rendering |
| Nodes | Hierarchical tree view of shape node structure |
| Sequence | Animation sequence selector and playback (internal builds) |
| Material | Material list with click-to-edit and hover-to-highlight |
| LOD WIP | Generate mesh LODs with decimation (amount, sloppy mode, error target) |
Shape Stats Displayed
| Stat | Description |
|---|---|
| DetName | Current detail level name |
| Size | Detail size value |
| Polys | Polygon count |
| Pixel | Pixel size |
| Materials | Material count |
| DrawCalls | Draw call count |
| Bones / Weights | Skeletal info |
| ColMeshes / ColPolys | Collision mesh stats |
Usage Example
-- Load a shape programmatically:
editor_shapeEditor.showShapeEditorLoadFile("/levels/GridMap/art/shapes/buildings/busstop_grid.dae")
-- Or select a TSStatic in the scene tree and click "Open in Shape Editor" in the inspector.Notes
- Uses
ShapePreviewC++ object for offscreen rendering - Material highlighting creates a temporary clone material with a highlight texture
- LOD generation writes
.csconstructor files for engine-level mesh decimation - Auto-open on selection controlled by
shapeEditor.general.autoOpenSelectedObjectpreference
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
Sensor Debugger
Camera sensor debug window - lists all active camera sensors and provides preview toggle for visualizing their color, annotation, and depth outputs.
Shortcut Legend
Displays a context-sensitive keyboard/mouse shortcut legend bar at the bottom of the editor, showing all available shortcuts for the current edit mode.