Merge pull request #94603 from aaronfranke/editor-insp-edit

Expose EditorInspector.edit to scripting
This commit is contained in:
Thaddeus Crews
2024-12-16 12:09:37 -06:00
2 changed files with 9 additions and 0 deletions

View File

@ -14,6 +14,14 @@
<tutorials>
</tutorials>
<methods>
<method name="edit">
<return type="void" />
<param index="0" name="object" type="Object" />
<description>
Shows the properties of the given [param object] in this inspector for editing. To clear the inspector, call this method with [code]null[/code].
[b]Note:[/b] If you want to edit an object in the editor's main inspector, use the [code]edit_*[/code] methods in [EditorInterface] instead.
</description>
</method>
<method name="get_edited_object">
<return type="Object" />
<description>

View File

@ -4648,6 +4648,7 @@ void EditorInspector::_handle_menu_option(int p_option) {
}
void EditorInspector::_bind_methods() {
ClassDB::bind_method(D_METHOD("edit", "object"), &EditorInspector::edit);
ClassDB::bind_method("_edit_request_change", &EditorInspector::_edit_request_change);
ClassDB::bind_method("get_selected_path", &EditorInspector::get_selected_path);
ClassDB::bind_method("get_edited_object", &EditorInspector::get_edited_object);