Skip to main content
Editor plugins allow you to extend the functionality of the Godot Editor. Plugins can add custom tools, importers, export functionality, and modify the editor interface.

EditorPlugin Class

All editor plugins inherit from the EditorPlugin class, which provides the foundation for extending the editor.

Basic Plugin Structure

Create a new plugin by extending EditorPlugin:
The @tool annotation (or [Tool] attribute in C#) is required for editor scripts to run in the editor.

Plugin Configuration

Create a plugin.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-left
  • DOCK_SLOT_LEFT_BL - Left side, bottom-left
  • DOCK_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-left
  • DOCK_SLOT_RIGHT_UR - Right side, upper-right
  • DOCK_SLOT_RIGHT_BR - Right side, bottom-right
  • DOCK_SLOT_BOTTOM - Bottom panel

Custom Import Plugins

Create plugins to import custom file formats:
Register the import plugin:
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

Always check Engine.is_editor_hint() before running editor-specific code to prevent issues at runtime.

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:
Register the inspector plugin:

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 plugins
  • AFTER_GUI_INPUT_STOP - Consume input, prevent other plugins
  • AFTER_GUI_INPUT_CUSTOM - Pass to other plugins except main Node3D
For 2D viewport:
  • Return true to consume input
  • Return false to 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