EditorPlugin Class
All editor plugins inherit from theEditorPlugin class, which provides the foundation for extending the editor.
Basic Plugin Structure
Create a new plugin by extendingEditorPlugin:
The
@tool annotation (or [Tool] attribute in C#) is required for editor scripts to run in the editor.Plugin Configuration
Create aplugin.cfg file in your addon directory:
Creating Editor Plugins
Basic Plugin Methods
Handling Specific Object Types
Create plugins that edit specific node or resource types:Adding Custom Dock Panels
Add custom docks to the editor interface:Dock Slot Positions
DOCK_SLOT_LEFT_UL- Left side, upper-leftDOCK_SLOT_LEFT_BL- Left side, bottom-leftDOCK_SLOT_LEFT_UR- Left side, upper-right (Scene/Import dock)DOCK_SLOT_LEFT_BR- Left side, bottom-right (FileSystem dock)DOCK_SLOT_RIGHT_UL- Right side, upper-left (Inspector/Node/History)DOCK_SLOT_RIGHT_BL- Right side, bottom-leftDOCK_SLOT_RIGHT_UR- Right side, upper-rightDOCK_SLOT_RIGHT_BR- Right side, bottom-rightDOCK_SLOT_BOTTOM- Bottom panel
Custom Import Plugins
Create plugins to import custom file formats:See the Import System page for more details on custom importers.
Tool Scripts
Tool scripts run in the editor and can be used for editor automation:Tool Script Best Practices
Enabling and Disabling Plugins
Plugins can be managed programmatically:Main Screen Plugins
Create plugins that add new tabs to the main editor screen:Inspector Plugins
Customize how properties appear in the Inspector:Viewport Plugins
Handle input and draw overlays in the 2D/3D viewports:Input Handling Return Values
For 3D viewport:AFTER_GUI_INPUT_PASS- Forward input to other pluginsAFTER_GUI_INPUT_STOP- Consume input, prevent other pluginsAFTER_GUI_INPUT_CUSTOM- Pass to other plugins except main Node3D
- Return
trueto consume input - Return
falseto forward input
Adding Tools Menu Items
Custom Types
Register custom node types that appear in the Create Node dialog:Plugin State and Layout
Save and restore plugin state:Example: Complete Plugin
See Also
Editor Interface
Learn about the editor interface components
Import System
Deep dive into custom importers
Custom Nodes
Create custom node types with editor features