Skip to content

Commit

Permalink
Improve Scene Tree editor performance
Browse files Browse the repository at this point in the history
We now cache the Node*<>TreeItem* mapping in the SceneTreeEditor. This
allows us to make targeted updates to the Tree used to display the scene
tree in the editor.

Previously on almost all changes to the scene tree the editor would
rebuild the entire widget, causing a large number of deallocations an
allocations. We now carefully manipulate the Tree widget in-situ saving
a large number of these allocations.

There is definitely more that could be done, but this is already a
massive improvement.

This fixes godotengine#83460
  • Loading branch information
hpvb committed Dec 4, 2024
1 parent 0f20e67 commit d31a7f8
Show file tree
Hide file tree
Showing 9 changed files with 631 additions and 117 deletions.
5 changes: 5 additions & 0 deletions doc/classes/Node.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,11 @@
Emitted when the node's editor description field changed.
</description>
</signal>
<signal name="editor_state_changed">
<description>
Emitted when an attribute of the node that is relevant to the editor is changed. Only emitted in the editor.
</description>
</signal>
<signal name="ready">
<description>
Emitted when the node is considered ready, after [method _ready] is called.
Expand Down
1 change: 1 addition & 0 deletions editor/connections_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ ConnectDialog::ConnectDialog() {
from_signal->set_editable(false);

tree = memnew(SceneTreeEditor(false));
tree->set_update_when_invisible(false);
tree->set_connecting_signal(true);
tree->set_show_enabled_subscene(true);
tree->set_v_size_flags(Control::SIZE_FILL | Control::SIZE_EXPAND);
Expand Down
Loading

0 comments on commit d31a7f8

Please sign in to comment.