Introduction to editor development

On this page, you will learn:

  • design decisions behind the Godot editor.
  • How to work efficiently on the Godot editor’s C++ code. Making plugins instead. See also Godot’s design philosophy before continuing. Since the Godot editor is a Godot project written in C++, much of the engine’s philosophy applies to the editor.

    Technical choices

    UI system. It does not rely on a toolkit such as GTK or Qt. This is similar in spirit to software like Blender. While using toolkits makes it easier to achieve a “native” appearance, they are also quite heavy and their licensing is not compatible with Godot’s. The editor is fully written in C++. It can’t contain any GDScript or C# code.

    Directory structure

    editor/ folder of the Godot source repository. modules. Some of these are only enabled in editor builds to decrease the binary size of export templates. See the modules/ folder in the Godot source repository. Some important files in the editor are:
  • editor/editor_node.cpp: Main editor initialization file. Effectively the “main scene” of the editor.
  • editor/project_manager.cpp: Main project manager initialization file. Effectively the “main scene” of the project manager.
  • editor/plugins/canvas_item_editor_plugin.cpp: The 2D editor viewport and related functionality (toolbar at the top, editing modes, overlaid helpers/panels, …).
  • editor/plugins/spatial_editor_plugin.cpp: The 3D editor viewport and related functionality (toolbar at the top, editing modes, overlaid panels, …).
  • editor/spatial_editor_gizmos.cpp: Where the 3D editor gizmos are defined and drawn. This file doesn’t have a 2D counterpart as 2D gizmos are drawn by the nodes themselves.

    scene/ files

    scene/ folder. not introduce new dependencies to editor/ includes in other folders such as scene/. This applies even if you use #ifdef TOOLS_ENABLED. To make the codebase easier to follow and more self-contained, the allowed dependency order is:
  • editor/ -> scene/ -> servers/ -> core/ editor/ can depend on includes from scene/, servers/, and core/. But, for example, while scene/ can depend on includes from servers/ and core/, it cannot depend on includes from editor/. editor/ includes in scene/ files, but they are in the process of being removed.

    Development tips

    open it from the command line after compiling the editor. This way, you don’t have to go through the project manager every time you start Godot.