Skip to content

[3.x] Remove vi_visible flag from Spatial. #107493

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

Merged
merged 1 commit into from
Jun 22, 2025

Conversation

lawnjelly
Copy link
Member

Can be replaced by is_visible_in_tree().

Now we have faster pre-calculated visible_in_tree flag (#107324) there is no need for the VisualInstance specific flag vi_visible which can be replaced by the more encompassing flag.

Here the methods to generate and accecss vi_visible are removed, and use cases are changed to use is_visible_in_tree().

Notes

  • I haven't attempted to change visible_in_tree propagation here, that would be for another PR.

@lawnjelly lawnjelly added this to the 3.7 milestone Jun 13, 2025
@lawnjelly lawnjelly requested review from a team as code owners June 13, 2025 15:35
Can be replaced by `is_visible_in_tree()`.
@lawnjelly lawnjelly force-pushed the remove_vi_visible branch from 7769ee9 to e430053 Compare June 16, 2025 16:56
@lawnjelly
Copy link
Member Author

lawnjelly commented Jun 16, 2025

Have renamed the function and added a comment. I hadn't noticed that it actually refreshes it on ENTER_WORLD rather than ENTER_TREE, but that is historical and I'm assuming working fine (I'll double check, but I'll avoid changing unless necessary to avoid regressions).

UPDATE:
NOTIFICATION_ENTER_WORLD gets sent during NOTIFICATION_ENTER_TREE for Spatial so it should be fine. 👍

Copy link
Member

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me now. Thanks for the changes!

I'm not super convinced that _update_server_visibility_and_xform is only called if effectively_visible != was_effectively_visible — I have a feeling we might be sending NOTIFICATION_VISIBILITY_CHANGED notifications into it without checking effective visibility. I might be wrong.
But the function itself looks sound to me.

@lawnjelly lawnjelly merged commit 84f761b into godotengine:3.x Jun 22, 2025
14 checks passed
@lawnjelly lawnjelly deleted the remove_vi_visible branch June 22, 2025 12:11
@lawnjelly
Copy link
Member Author

Thanks!

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.

2 participants