godotengine / godotengine/godot
3D viewport sun rotation not update after reopen the project.
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproduce in 4.6-stable.
### System information
Windows 11 - 4.6.stable
### Issue description
3D viewport sun rotation not update when set editor states.
### Steps to reproduce
1. Set 3D viewport lighting preview settings, change the sun rotation.
2. Save a 3D scene.
3. Reopen the project, the sun is still the default value.
Default settings:
Change sun rotation and save:
Reopen the project, all settings are recovered but sun rotation:
editor/scene/3d/node_3d_editor_plugin.cpp
https://github.com/godotengine/godot/blob/77579f93e6ee7cf2515da4a7a5000d8a0244be98/editor/scene/3d/node_3d_editor_plugin.cpp
in set_state function:
https://github.com/godotengine/godot/blob/77579f93e6ee7cf2515da4a7a5000d8a0244be98/editor/scene/3d/node_3d_editor_plugin.cpp#L7210
https://github.com/godotengine/godot/blob/77579f93e6ee7cf2515da4a7a5000d8a0244be98/editor/scene/3d/node_3d_editor_plugin.cpp#L7317
```c++
sun_rotation = pd["sun_rotation"];
environ_sky_color->set_pick_color(pd["environ_sky_color"]);
environ_ground_color->set_pick_color(pd["environ_ground_color"]);
```
should update like other settings:
```c++
sun_angle_altitude->set_value_no_signal(-Math::rad_to_deg(sun_rotation.x));
sun_angle_azimuth->set_value_no_signal(180.0 - Math::rad_to_deg(sun_rotation.y));
```
### Minimal reproduction project (MRP)
Test in any project.
Contributor guide
Research direction
Start in editor/scene/3d/node_3d_editor_plugin.cpp at the set_state function around the linked lines, and compare sun_rotation restoration with the other lighting settings. Ensure the saved rotation is reflected in the sun altitude and azimuth controls, then reopen a saved 3D scene to verify the changed sun rotation is restored.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics, tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100