The Editor Inspector system provides the user interface for viewing and modifying object properties. It is built on a modular architecture consisting of the EditorInspector container, individual EditorProperty widgets, and an extension system via EditorInspectorPlugin.
The inspector dynamically populates itself by querying an object's property list and matching each property to an appropriate EditorProperty implementation. This process can be intercepted and customized by plugins.
Architecture diagram: Inspector class relationships
Sources: editor/inspector/editor_inspector.h34-51 editor/inspector/editor_inspector.h70-208 editor/inspector/editor_resource_picker.h37-111
EditorInspector is the central control for property management. It handles object lifecycle in the UI, property filtering, and section grouping.
| Method | Description |
|---|---|
edit(Object *p_object) | Sets the object to be inspected and triggers a tree update. editor/inspector/editor_inspector.cpp253 |
get_edited_object() | Returns the pointer to the currently inspected object. editor/inspector/editor_inspector.cpp260 |
_property_path_matches(...) | Helper used for the inspector search filter. editor/inspector/editor_inspector.cpp87-99 |
instantiate_property_editor(...) | Static helper to create the correct EditorProperty for a given type and hint. editor/inspector/editor_inspector.cpp274 |
The inspector organizes properties based on PropertyInfo usage flags:
PROPERTY_USAGE_CATEGORY creates a major separator, usually representing the class name. editor/inspector/editor_inspector.cpp126-133PROPERTY_USAGE_GROUP creates collapsible sections. The hint_string defines the property name prefix to include in the group. editor/inspector/editor_inspector.cpp118-121PROPERTY_USAGE_SUBGROUP provides a second level of nesting. editor/inspector/editor_inspector.cpp112-115Natural Language to Code Space: Property Organization
Sources: editor/inspector/editor_inspector.cpp87-170 editor/inspector/editor_inspector.h112-133
EditorProperty is the base class for all property-specific UI. It handles the common layout including the property label, revert button, and pinning logic.
Godot provides a wide array of specialized property editors in editor_properties.cpp and editor_properties_array_dict.cpp:
EditorPropertyVariant: A meta-editor that allows changing the type of a Variant property via EditorVariantTypePopupMenu. editor/inspector/editor_properties.cpp90-110EditorPropertyText: Uses a LineEdit for strings and StringName. editor/inspector/editor_properties.h95-118EditorPropertyArrayObject: A helper object that acts as a proxy to edit individual elements of an Array. editor/inspector/editor_properties_array_dict.cpp53-69EditorPropertyDictionaryObject: A proxy for Dictionary editing, handling keys and values. editor/inspector/editor_properties_array_dict.cpp105-127When a user interacts with a widget:
EditorProperty subclass detects the change.emit_changed(property, new_value). editor/inspector/editor_inspector.h230EditorInspector receives the signal and updates the object, typically via EditorUndoRedoManager.Sources: editor/inspector/editor_properties.cpp77-170 editor/inspector/editor_properties_array_dict.cpp53-225 editor/inspector/editor_inspector.h213-230
Plugins allow developers to provide custom UI for specific types or individual properties.
_can_handle(Object *p_object): Determines if the plugin should process properties for this object. editor/inspector/editor_inspector.cpp340add_property_editor(String p_property, Control *p_editor): Injects a custom widget for a specific property. editor/inspector/editor_inspector.cpp368_parse_begin(Object *p_object): Allows adding controls to the very top of the inspector. editor/inspector/editor_inspector.cpp347Sources: editor/inspector/editor_inspector.cpp340-375 doc/classes/EditorPlugin.xml40-47
The EditorResourcePicker is a specialized HBoxContainer used for properties that hold a Resource.
base_type to filter which resources can be assigned. editor/inspector/editor_resource_picker.h91PopupMenu. editor/inspector/editor_resource_picker.cpp126-156EditorResourcePreview to show thumbnails of the assigned resource. editor/inspector/editor_resource_picker.cpp120-122Code Entity Space: Resource Selection Flow
Sources: editor/inspector/editor_resource_picker.cpp89-156 editor/inspector/editor_resource_picker.h37-111
While distinct from the main inspector, EditorAutoloadSettings uses similar Tree and Property logic to manage global scripts. It validates names to ensure they do not collide with built-in classes or keywords.
Refresh this wiki
This wiki was recently refreshed. Please wait 4 days to refresh again.