-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saving sub-scenes will mess up the display of the main scene on the 2D screen #90301
Comments
it seems the Camera is always rendered at the exact same position and everything else is rendered based on there relative position as if it became the actual Camera of the 2D editor. The exact position seems to depend on the size of the 2D Editor |
I discovered that the auto-reload here causes Lines 314 to 316 in e5b4ef8
Lines 2573 to 2576 in e5b4ef8
This may be due to the current editing scene root not being set to the main scene root after switching tabs but before auto-reloading. |
EDIT: |
It doesn't seem to be fully fixed by #90317. It seems that we can not use Lines 704 to 711 in a7b8602
So directly call diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 72225fd454..bdc6504417 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -722,8 +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);
+ EditorNode::get_singleton()->set_edited_scene(new_scene);
memdelete(old_root);
edited_scene.write[p_idx].selection = new_selection;
|
Tested versions
v4.3.dev5.official [c9c17d6] good
f47f4a0 bad
System information
Linux Mint 21.3 (Virginia) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 Ti (nvidia; 535.161.07) - Intel(R) Core(TM) i5-7300HQ CPU @ 2.50GHz (4 Threads)
Issue description
Saving the sub-scene and switching to the main scene reloads the scene, and it seems like the position calculation of something is dependent on the current camera.
If there is a enabled (default value)
Camera2D
node in the main scene, some things in the main scene will be displayed in the wrong position after reloading. For example, the position of the camera screen rectangle.Parallax2D
'sscreen_offset
may also change.0.mp4
Closing and reopening the scene will display correctly.
Steps to reproduce
Minimal reproduction project (MRP)
wrong_display.zip
The text was updated successfully, but these errors were encountered: