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

add allow_all and deny_all methods to DynamicSceneBuilder #15222

Merged
merged 12 commits into from
Sep 15, 2024

Conversation

atornity
Copy link
Contributor

Objective

It would be convenient to be able to quickly deny or allow all components and resources on a DynamicSceneBuilder with a single method call.

Context: #15210 renamed {allow/deny}_all to {allow/deny}_all_components.

Solution

Added two new methods to DynamicSceneBuilder, allow_all and deny_all, which affect both the component and resource filters.

Showcase

Before

let builder = DynamicSceneBuilder::from_world(world)
    .deny_all_components()
    .deny_all_resources();

After

let builder = DynamicSceneBuilder::from_world(world).deny_all();

@alice-i-cecile alice-i-cecile added C-Usability A targeted quality-of-life change that makes Bevy easier to use A-Scenes Serialized ECS data stored on the disk S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 15, 2024
@janhohenheim
Copy link
Member

Doesn't this mean that the preexisting allow_all and deny_all calls by the users will have different semantics now? That should probably be mentioned in the migration guide.

@janhohenheim janhohenheim added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 15, 2024
@alice-i-cecile
Copy link
Member

Agreed; I'll update the migration guide of the linked PR.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Sep 15, 2024
Merged via the queue into bevyengine:main with commit d878e2f Sep 15, 2024
30 checks passed
@atornity atornity deleted the scene-builder-allow-deny-all branch September 15, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Scenes Serialized ECS data stored on the disk C-Usability A targeted quality-of-life change that makes Bevy easier to use 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.

3 participants