Skip to content

Commit

Permalink
Large scene edit optimizations (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan-000 committed Nov 3, 2024
1 parent 386ff93 commit d9d23c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion editor/gui/scene_tree_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,12 @@ void SceneTreeEditor::_compute_hash(Node *p_node, uint64_t &hash) {
}

for (int i = 0; i < p_node->get_child_count(); i++) {
_compute_hash(p_node->get_child(i), hash);
Node *child = p_node->get_child(i);
// if the child is not owned, skip.
if (!child->get_owner()) {
continue;
}
_compute_hash(child, hash);
}
}

Expand Down
6 changes: 6 additions & 0 deletions editor/scene_tree_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2008,6 +2008,12 @@ void SceneTreeDock::perform_node_renames(Node *p_base, HashMap<Node *, NodePath>
return;
}

// if it has no owner, but its not the root node, return early
if (!p_base->get_owner() && p_base != p_base->get_tree()->get_edited_scene_root()) {
// possibly special case for ->is_editable_instance()?
return;
}

// No renaming if base node is deleted.
HashMap<Node *, NodePath>::Iterator found_base_path = p_renames->find(p_base);
if (found_base_path && found_base_path->value.is_empty()) {
Expand Down

0 comments on commit d9d23c2

Please sign in to comment.