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
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 sphere visualization.
Public API
| Function | Signature | Description |
|---|---|---|
M.onEditorInitialized() | Registers decalEditMode edit mode and tool window | |
M.onEditorGui() | Renders Templates tab, Instances tab, and sphere alpha slider | |
M.onEditorBeforeSaveLevel() | Auto-saves all decals before level save | |
M.onEditorInspectorFieldChanged(ids, field, value, idx) | Marks changed DecalData as dirty, updates instances | |
M.onEditorInspectorHeaderGui(info) | Shows material preview in inspector header | |
M.onEditorAxisGizmoAligmentChanged() | Updates gizmo position on alignment change | |
M.onExtensionLoaded() | Logs initialization |
Edit Mode
| Property | Value |
|---|---|
| Display Name | "Edit Decal" |
| Action Map | "DecalEditor" |
| Icon | editor.icons.create_decal |
Shortcuts
- Ctrl + Click: Multi-select instances
- Shift + Drag Gizmo: Duplicate selected decals
Key Features
Spatial Grid System
- Accelerated instance lookup using a grid with 50m cell size
- Auto-rebuilds when decal count changes or flagged dirty
- Visible instances culled to 250m draw distance
Debug Spheres
- Color-coded per instance ID, green for selected, yellow for hovered
- Configurable alpha slider (0 = hidden)
- Text labels within 50m: name, ID, distance
Template Management
- Create / Delete / Save individual / Save all templates
- Hidden templates:
DummyDecal,tireTrackDecal - Material preview image in template and instance panels
Instance Management
- Tree view grouped by template name
- Position, rotation (Euler), and size editing
- Multi-selection with average gizmo position
- Duplicate via Shift+drag
Undo/Redo Actions
| Action | Description |
|---|---|
CreateDecalTemplate | Create a new DecalData template |
DeleteDecalTemplate | Delete template and all its instances |
CreateDecalInstance | Place a new decal instance |
DeleteDecalInstance | Remove selected instances |
DuplicateDecalInstances | Duplicate via shift-drag |
PositionDecalInstances | Move instances |
RotateDecalInstances | Rotate instances (with position orbit) |
ChangeDecalInstancesSize | Scale instances |
SelectSingleInst / AddDecalInstToSelection / RemoveDecalInstFromSelection / ClearDecalSelection | Selection changes |
Notes
- Gizmo alignment: Local (single selection uses instance matrix) vs World (average position)
- Ray-sphere intersection for mouse picking instead of engine raycasts
- Instance rotation stored as normal + tangent vectors, converted to/from Euler for UI
- Template dirty state tracked via
editor.isDecalDirty()/editor.saveDecal()
See Also
- Editor AI Tests - Related reference
- Editor AI Visualization - Related reference
- Editor – Assembly Spline Tool - Related reference
- World Editor Guide - Guide
DataBlock Editor
Editor window for browsing, creating, deleting, and saving SimDataBlock objects. Provides a two-tab interface (Existing/New) with inspector integration.
Decal Spline Editor
Spline-based decal placement tool. Creates and manages decal splines that automatically populate decal instances along a path with configurable materials, spacing, jitter, rotation, and multi-componen