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

Wireframe configuration #7309

Closed
Shatur opened this issue Jan 21, 2023 · 2 comments · Fixed by #7328
Closed

Wireframe configuration #7309

Shatur opened this issue Jan 21, 2023 · 2 comments · Fixed by #7328
Labels
A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use

Comments

@Shatur
Copy link
Contributor

Shatur commented Jan 21, 2023

What problem does this solve or what need does it fill?

Currently Wireframe is a marker component that enables wireframe for its entity. There is also a global switch to enable wireframe on all objecrts.
But sometimes it may be necessary to disable only certain entities. In this case I can't use global switch and need to add Wireframe component to every object I spawn except the ones I want to exclude. For example, I want to exclude wireframe for previews I that I generate:
изображение

What solution would you like?

It would be better if the Wireframe component acted like Visibility - containing a boolean field to turn it on and off. And global switch could be used to enable or disable the wireframe rendering entirely.

@Shatur Shatur added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Jan 21, 2023
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use and removed C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Jan 21, 2023
@alice-i-cecile
Copy link
Member

Why not just remove the component from the entities you want to exclude?

@Shatur
Copy link
Contributor Author

Shatur commented Jan 21, 2023

Because in cases like preview where I only need to exclude one entity (the one I use to generate previews), I need to add a Wireframe component to every object with mesh I create. I.e. I can't use the global switch because it turns on rendering for all entities regardless of the Wireframe component.

Wcubed added a commit to Wcubed/bevy that referenced this issue Jan 31, 2023
Wcubed added a commit to Wcubed/bevy that referenced this issue Mar 12, 2023
Wcubed added a commit to Wcubed/bevy that referenced this issue Mar 31, 2023
Wcubed added a commit to Wcubed/bevy that referenced this issue Jul 15, 2023
Wcubed added a commit to Wcubed/bevy that referenced this issue Oct 3, 2023
github-merge-queue bot pushed a commit that referenced this issue Oct 4, 2023
# Objective

Allow the user to choose between "Add wireframes to these specific
entities" or "Add wireframes to everything _except_ these specific
entities".
Fixes #7309

# Solution
Make the `Wireframe` component act like an override to the global
configuration.
Having `global` set to `false`, and adding a `Wireframe` with `enable:
true` acts exactly as before.
But now the opposite is also possible: Set `global` to `true` and add a
`Wireframe` with `enable: false` will draw wireframes for everything
_except_ that entity.

Updated the example to show how overriding the global config works.
regnarock pushed a commit to regnarock/bevy that referenced this issue Oct 13, 2023
# Objective

Allow the user to choose between "Add wireframes to these specific
entities" or "Add wireframes to everything _except_ these specific
entities".
Fixes bevyengine#7309

# Solution
Make the `Wireframe` component act like an override to the global
configuration.
Having `global` set to `false`, and adding a `Wireframe` with `enable:
true` acts exactly as before.
But now the opposite is also possible: Set `global` to `true` and add a
`Wireframe` with `enable: false` will draw wireframes for everything
_except_ that entity.

Updated the example to show how overriding the global config works.
ameknite pushed a commit to ameknite/bevy that referenced this issue Nov 6, 2023
# Objective

Allow the user to choose between "Add wireframes to these specific
entities" or "Add wireframes to everything _except_ these specific
entities".
Fixes bevyengine#7309

# Solution
Make the `Wireframe` component act like an override to the global
configuration.
Having `global` set to `false`, and adding a `Wireframe` with `enable:
true` acts exactly as before.
But now the opposite is also possible: Set `global` to `true` and add a
`Wireframe` with `enable: false` will draw wireframes for everything
_except_ that entity.

Updated the example to show how overriding the global config works.
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this issue Jan 9, 2024
# Objective

Allow the user to choose between "Add wireframes to these specific
entities" or "Add wireframes to everything _except_ these specific
entities".
Fixes bevyengine#7309

# Solution
Make the `Wireframe` component act like an override to the global
configuration.
Having `global` set to `false`, and adding a `Wireframe` with `enable:
true` acts exactly as before.
But now the opposite is also possible: Set `global` to `true` and add a
`Wireframe` with `enable: false` will draw wireframes for everything
_except_ that entity.

Updated the example to show how overriding the global config works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants