-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Fix 3D viewport grid disappearing on scene tab changes #78694
Fix 3D viewport grid disappearing on scene tab changes #78694
Conversation
Thanks for your first contribution! I haven't reviewed in depth but re-initializing state like this seems like a good approach to solving this issue. For the record, your commit seems not to be linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info. |
5b92e7a
to
a8dde28
Compare
@akien-mga Thanks for bringing this to my attention. I have changed my git config and pushed which also removes a blank space added unnecessarily in the previous commit. Resetting the state seemed like a quick and feasible approach. It works fine for the given use case as well as a few more tests I performed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked through the surrounding code a bit and this seems to be the correct solution. The MENU_VIEW_GRID
checkbox is set to true
in the line above, so the grid_enabled
setting needs to be updated to match. grid_init_draw
specifies whether the grid should be redrawn (if false
it redraws), and it should in this case, so setting it to false
is correct
Thanks! And congrats for your first merged Godot contribution 🎉 |
Cherry-picked for 4.1.1. |
Grid disappearance in 3D viewport on scene change occurred because editor states which controlled grid draw and update were not being reset on scene change.
Fixed grid disappearance in 3D viewport on scene tab change by resetting the editor states for grid draw and update.