Skip to content

Fix scene_viewer setup retry when mesh AABBs are missing - #25667

Merged
alice-i-cecile merged 2 commits into
bevyengine:mainfrom
fmterrors:main
Oct 26, 2026
Merged

alice-i-cecile merged 2 commits into
bevyengine:mainfrom
fmterrors:main

Conversation

@fmterrors

Copy link
Copy Markdown
Contributor

Objective

Ensure that scene_viewer initializes its controllable camera and default light even when loaded scene meshes do not have Aabb components on the first setup attempt.

When SceneHandle::is_loaded becomes true, mesh bounds may still be pending. The setup system currently marks its local setup state before checking for missing Aabb components. If any mesh is missing an Aabb, the system returns and permanently skips the camera and light initialization.

Solution

Set the local setup flag only after the scene bounds have been calculated and the camera and light initialization logic has completed.

This allows the system to retry on subsequent frames while any mesh is still waiting for its Aabb.

Testing

  • cargo +nightly-2026-09-01 check --example scene_viewer --features free_camera,bevy_dev_tools
  • rustfmt --edition 2024 --check examples/tools/scene_viewer/main.rs
  • git diff --check

Showcase

This section is optional. If this PR does not include a visual change or does not add a new feature, you can delete this section.

  • Help others understand the result of this PR by showcasing your awesome work!
  • If this PR adds a new feature or public API, consider adding a brief pseudo-code snippet of it in action
  • If this PR includes a visual change, consider adding a screenshot, GIF, or video
    • If you want, you could even include a before/after comparison!
  • If the Migration Guide adequately covers the changes, you can delete this section

While a showcase should aim to be brief and digestible, you can use a toggleable section to save space on longer showcases:

Click to view showcase
println!("My super cool code.");

Signed-off-by: fmterrors <fmterrors@outlook.com>
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨

@fmterrors

Copy link
Copy Markdown
Contributor Author

@Zeophlite Hi, when you have a chance, could you please take a look at this PR? It fixes scene_viewer setup being permanently skipped when mesh AABBs are not ready on the first setup attempt. Thanks!

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior D-Trivial Nice and easy! A great choice to get started with Bevy C-Examples An addition or correction to our examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 25, 2026
@alice-i-cecile alice-i-cecile added A-Dev-Tools Tools used to debug Bevy applications. S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it AI-Free Does not disclose the use of AI and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 25, 2026
@alice-i-cecile
alice-i-cecile added this pull request to the merge queue Oct 26, 2026
Merged via the queue into bevyengine:main with commit efd256f Oct 26, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Dev-Tools Tools used to debug Bevy applications. AI-Free Does not disclose the use of AI C-Bug An unexpected or incorrect behavior C-Examples An addition or correction to our examples D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants