EditorInterface is the primary public API surface for interacting with the Godot editor from scripts and plugins. It is a singleton Object (not a Node) that exposes editor functionality in a stable, script-accessible form. It does not implement editor logic itself — it delegates to internal singletons such as EditorNode, EditorSettings, EditorFileSystem, and others.
For information about the orchestrating editor class that owns most of the UI, see EditorNode. For the plugin system that consumes EditorInterface, see EditorPlugin System. For the data structures that track open scenes and plugin state, see EditorData.
EditorInterface is a thin facade registered as a global singleton. Editor plugins access it by name in GDScript (EditorInterface.get_editor_settings()) or via EditorInterface.Singleton in C#. In C++, EditorInterface::get_singleton() is used.
EditorInterface in the editor architecture:
Sources: editor/editor_interface.h62-200 editor/editor_interface.cpp67-110
The class is declared in editor/editor_interface.h and implemented in editor/editor_interface.cpp It is a singleton with the static pattern EditorInterface *EditorInterface::singleton = nullptr.
Many methods in EditorInterface are simply pass-throughs. For example, get_selection() calls EditorNode::get_singleton()->get_editor_selection(), and get_editor_settings() returns EditorSettings::get_singleton() directly.
EditorInterface has a static singleton member and is accessed via get_singleton(). It is not a Node and does not participate in the scene tree. It is instantiated by the editor startup sequence before plugins are loaded.
Singleton access pattern:
Sources: editor/editor_interface.h62-97 editor/editor_interface.cpp67-108
Methods that return references to core editor singletons and subsystems.
| Method | Return Type | Delegates To |
|---|---|---|
get_command_palette() | EditorCommandPalette* | EditorCommandPalette::get_singleton() |
get_resource_filesystem() | EditorFileSystem* | EditorFileSystem::get_singleton() |
get_editor_paths() | EditorPaths* | EditorPaths::get_singleton() |
get_resource_previewer() | EditorResourcePreview* | EditorResourcePreview::get_singleton() |
get_selection() | EditorSelection* | EditorNode::get_singleton()->get_editor_selection() |
get_editor_settings() | Ref<EditorSettings> | EditorSettings::get_singleton() |
get_editor_toaster() | EditorToaster* | EditorToaster::get_singleton() |
get_editor_undo_redo() | EditorUndoRedoManager* | EditorUndoRedoManager::get_singleton() |
Sources: editor/editor_interface.cpp78-108 editor/editor_interface.h103-110
Methods that expose editor UI nodes. These return live UI nodes, so they must not be freed by callers.
| Method | Return Type | Notes |
|---|---|---|
get_base_control() | Control* | Root container of the editor window |
get_editor_main_screen() | VBoxContainer* | Main screen area for plugins with _has_main_screen() |
get_script_editor() | ScriptEditor* | The script editor panel |
get_editor_viewport_2d() | SubViewport* | The 2D editor viewport |
get_editor_viewport_3d(idx) | SubViewport* | One of four 3D editor viewports (idx 0–3) |
get_editor_theme() | Ref<Theme> | The current editor theme |
get_editor_scale() | float | Current UI scale factor |
get_editor_language() | String | Current editor UI locale |
get_file_system_dock() | FileSystemDock* | The FileSystem dock |
get_inspector() | EditorInspector* | The inspector panel |
Sources: editor/editor_interface.h119-136 doc/classes/EditorInterface.xml59-163
get_editor_viewport_3d(idx) accepts an index from 0 to 3, corresponding to the four split views available in the 3D editor. The returned SubViewport can be used to obtain the active Camera3D via Viewport.get_camera_3d().
These methods interact with the currently open scene. They delegate to EditorNode.
| Method | Signature | Description |
|---|---|---|
get_edited_scene_root() | → Node | Returns the root of the currently edited scene |
add_root_node(node) | void | Sets root of an empty scene |
open_scene_from_path(path, set_inherited) | void | Opens a scene by file path |
reload_scene_from_path(path) | void | Reloads a scene from disk |
close_scene() | Error | Closes the active scene, discarding changes |
get_open_scenes() | PackedStringArray | Lists all open scene file paths |
save_scene() | Error | Saves the current scene |
save_scene_as(path, with_preview) | void | Saves current scene to a specific path |
save_all_scenes() | void | Saves all open scenes |
mark_scene_as_unsaved() | void | Flags the current scene as having unsaved changes |
edit_node(node) | void | Selects and edits a node |
edit_resource(resource) | void | Opens a resource for editing in the inspector |
edit_script(script, line, col, grab_focus) | void | Opens a script at a specific line/column |
Sources: doc/classes/EditorInterface.xml22-58 editor/editor_interface.cpp
| Method | Signature | Description |
|---|---|---|
inspect_object(object, for_property, inspector_only) | void | Shows an object in the inspector |
get_inspector() | EditorInspector* | Returns the Inspector dock's EditorInspector instance |
| Method | Signature | Description |
|---|---|---|
get_file_system_dock() | FileSystemDock* | Returns the FileSystem dock |
get_current_path() | String | Currently selected path in the FileSystem dock |
get_current_directory() | String | Currently viewed directory |
select_file(file) | void | Selects a file in the FileSystem dock |
Sources: doc/classes/EditorInterface.xml73-98
| Method | Signature | Description |
|---|---|---|
set_plugin_enabled(plugin, enabled) | void | Enables or disables an addon plugin by folder name |
is_plugin_enabled(plugin) | bool | Returns whether an addon is enabled |
These delegate to EditorNode::set_addon_plugin_enabled() / is_addon_plugin_enabled().
Sources: editor/editor_interface.h115-116 editor/editor_interface.cpp
| Method | Signature | Description |
|---|---|---|
get_current_feature_profile() | String | Name of the active feature profile, or "" for default |
set_current_feature_profile(profile_name) | void | Activates a feature profile by name |
Sources: doc/classes/EditorInterface.xml79-85
EditorInterface provides methods to open standard editor dialogs and receive the result via a Callable.
| Method | Description |
|---|---|
popup_dialog(dialog, rect) | Opens a Window at a given screen rect |
popup_dialog_centered(dialog, minsize) | Centers a dialog on screen |
popup_dialog_centered_ratio(dialog, ratio) | Centers with a fraction of screen size |
popup_dialog_centered_clamped(dialog, minsize, fallback_ratio) | Centers, clamped to minimum size |
popup_node_selector(callback, valid_types, current_value) | Shows node picker; calls callback(NodePath) |
popup_property_selector(object, callback, type_filter, current_value) | Shows property picker; calls callback(String) |
popup_method_selector(object, callback, current_value) | Shows method picker; calls callback(String) |
popup_quick_open(callback, base_types) | Shows the quick-open dialog |
popup_create_dialog(callback, base_type, current_type, title, blocklist) | Shows "Create New" dialog |
Internally, these dialogs (PropertySelector, SceneTreeDialog, CreateDialog) are held as members of EditorInterface itself and reused across calls.
Sources: editor/editor_interface.h67-79 editor/editor_interface.cpp doc/classes/EditorInterface.xml
| Method | Signature | Description |
|---|---|---|
make_mesh_previews(meshes, preview_size) | TypedArray<Texture2D> | Renders thumbnail previews for Mesh resources |
make_scene_preview(path, scene, preview_size) | void | Generates and caches a thumbnail for a scene |
make_mesh_previews uses a temporary SubViewport setup to render each mesh and return an array of Texture2D thumbnails. The internal helper _calculate_aabb_for_scene is used to fit the camera to the mesh bounds.
Sources: editor/editor_interface.cpp110-139 editor/editor_interface.h112-113
| Method | Return Type | Description |
|---|---|---|
is_node_3d_snap_enabled() | bool | Whether 3D snap is currently active |
get_node_3d_translate_snap() | real_t | Snap distance for translation |
get_node_3d_rotate_snap() | real_t | Snap angle for rotation (degrees) |
get_node_3d_scale_snap() | real_t | Snap factor for scaling |
Sources: editor/editor_interface.h136-139
| Method | Description |
|---|---|
set_distraction_free_mode(enter) | Enters or exits distraction-free mode (hides docks) |
is_distraction_free_mode_enabled() | Returns current distraction-free state |
is_multi_window_enabled() | Returns whether editor supports floating sub-windows |
set_main_screen_editor(name) | Switches to the named main screen tab ("2D", "3D", "Script", etc.) |
restart_editor(save) | Restarts the editor, optionally saving scenes first |
Sources: editor/editor_interface.h128-132 editor/editor_interface.cpp69-73
The diagram below maps key EditorInterface method groups to the internal targets they call.
EditorInterface delegation targets:
Sources: editor/editor_interface.cpp69-400 editor/editor_interface.h96-200
EditorInterface includes a compatibility file editor/editor_interface.compat.inc that provides deprecated method bindings. These are guarded by #ifndef DISABLE_DEPRECATED in the header. Notable compatibility bindings include:
_popup_node_selector_bind_compat_94323 — older signature for popup_node_selector_popup_property_selector_bind_compat_94323 — older signature for popup_property_selector_open_scene_from_path_bind_compat_90057 — older signature without set_inherited parameterSources: editor/editor_interface.h89-94
EditorPlugin subclasses access EditorInterface directly by name. The EditorInterface object is available as a global singleton throughout the editor's lifetime.
# GDScript plugin usage
func _enter_tree():
var settings = EditorInterface.get_editor_settings()
var scene_root = EditorInterface.get_edited_scene_root()
EditorInterface.set_main_screen_editor("2D")
The get_editor_theme() method is commonly used in plugins to access icon resources:
# Get a built-in icon
var icon = EditorInterface.get_editor_theme().get_icon("Node", "EditorIcons")
Sources: doc/classes/EditorPlugin.xml243-254 doc/classes/EditorSettings.xml12-26
Refresh this wiki
This wiki was recently refreshed. Please wait 3 days to refresh again.