Merge pull request #90317 from ajreckof/Fix-strange-visual-bug-with-camera-and-external-change-

Fix strange visual bug with camera and external change.
This commit is contained in:
Rémi Verschelde 2024-04-08 14:04:45 +02:00
commit 7fa4698475
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 4 additions and 1 deletions

View File

@ -722,6 +722,7 @@ bool EditorData::check_and_update_scene(int p_idx) {
new_scene->set_scene_file_path(edited_scene[p_idx].root->get_scene_file_path());
Node *old_root = edited_scene[p_idx].root;
edited_scene.write[p_idx].root = new_scene;
old_root->replace_by(new_scene, false, false);
memdelete(old_root);
edited_scene.write[p_idx].selection = new_selection;

View File

@ -3674,7 +3674,9 @@ void EditorNode::set_edited_scene(Node *p_scene) {
if (old_edited_scene_root->get_parent() == scene_root) {
scene_root->remove_child(old_edited_scene_root);
}
old_edited_scene_root->disconnect(SNAME("replacing_by"), callable_mp(this, &EditorNode::set_edited_scene));
if (old_edited_scene_root->is_connected("replacing_by", callable_mp(this, &EditorNode::set_edited_scene))) {
old_edited_scene_root->disconnect(SNAME("replacing_by"), callable_mp(this, &EditorNode::set_edited_scene));
}
}
get_editor_data().set_edited_scene_root(p_scene);