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 bevy_pbr as a dependency to bevy_gizmos #11035

Closed
wants to merge 1 commit into from

Conversation

hecksmosis
Copy link
Contributor

@ItsDoot ItsDoot added C-Dependencies A change to the crates that Bevy depends on A-Gizmos Visual editor and debug gizmos labels Dec 20, 2023
@IceSentry
Copy link
Contributor

Like @irate-devil said in the comments of the original issue:

Always adding bevy_pbr as a feature would prevent users that only need bevy_sprite from disabling it, and vice versa.

So I'm not sure this is the right solution.

@hecksmosis
Copy link
Contributor Author

hecksmosis commented Dec 20, 2023

bevy_sprite doesn't require bevy_gizmos does it?

@mockersf
Copy link
Member

it should be possible to draw gizmos without having to bring bevy_pbr
for example cargo run --example 2d_gizmos --no-default-features --features "bevy_winit,bevy_ui,bevy_gizmos" works and doesn't bring bevy_pbr

github-merge-queue bot pushed a commit that referenced this pull request Jan 14, 2024
…11296)

# Objective

- `bevy_gizmos` cannot work if both `bevy_sprite` and `bevy_pbr` are
disabled.
- It silently fails to render, making it difficult to debug.
- Fixes #10984

## Solution

- Log an error message when `GizmoPlugin` is registered.

## Alternatives

I chose to log an error message, since it seemed the least intrusive of
potential solutions. Some alternatives include:

- Choosing one dependency as the default, neglecting the other. (#11035)
- Raising a compile error when neither dependency is enabled. ([See my
original
comment](#10984 (comment)))
- Raising a compile warning using a macro hack. ([Pre-RFC - Add
compile_warning!
macro](https://internals.rust-lang.org/t/pre-rfc-add-compile-warning-macro/9370/7?u=bd103))
- Logging a warning instead of an error.
- _This might be the better option. Let me know if I should change it._

---

## Changelog

- `bevy_gizmos` will now log an error if neither `bevy_pbr` nor
`bevy_sprite` are enabled.
@mockersf
Copy link
Member

fixed in #11296

@mockersf mockersf closed this Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Gizmos Visual editor and debug gizmos C-Dependencies A change to the crates that Bevy depends on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using bevy_gizmos feature with default-features=false renders nothing (requires extra bevy_pbr feature)
5 participants