Skip to content
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

Conversation

Yadnesh-Kulkarni
Copy link

@Yadnesh-Kulkarni Yadnesh-Kulkarni commented Jun 26, 2023

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.

@Yadnesh-Kulkarni Yadnesh-Kulkarni requested a review from a team as a code owner June 26, 2023 04:29
@akien-mga akien-mga added this to the 4.2 milestone Jun 26, 2023
@akien-mga
Copy link
Member

akien-mga commented Jun 26, 2023

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.

@Yadnesh-Kulkarni Yadnesh-Kulkarni force-pushed the bugfix-grid-view-disappear-#78588 branch from 5b92e7a to a8dde28 Compare June 26, 2023 13:34
@Yadnesh-Kulkarni
Copy link
Author

@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.

@YuriSizov YuriSizov changed the title Fixed grid disappearance issue #78588 Fix 3D viewport grid disappearing on scene tab changes Jun 26, 2023
Copy link
Member

@clayjohn clayjohn left a 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

@akien-mga akien-mga added the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jun 26, 2023
@YuriSizov YuriSizov requested a review from KoBeWi July 7, 2023 17:55
@akien-mga akien-mga merged commit e3dee8c into godotengine:master Jul 8, 2023
13 checks passed
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@Yadnesh-Kulkarni Yadnesh-Kulkarni deleted the bugfix-grid-view-disappear-#78588 branch July 8, 2023 16:31
@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jul 10, 2023
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grid view disappears
6 participants