-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Move aabb gizmos to bevy_dev_tools
#12354
base: main
Are you sure you want to change the base?
Conversation
bevy_dev_tools
bevy_dev_tools
It looks like your PR is a breaking change, but you didn't provide a migration guide. Could you add some context on what users should update when this change get released in a new version of Bevy? |
crates/bevy_dev_tools/src/lib.rs
Outdated
@@ -1,10 +1,13 @@ | |||
//! This crate provides additional utilities for the [Bevy game engine](https://bevyengine.org), | |||
//! focused on improving developer experience. | |||
|
|||
use bevy_app::prelude::*; | |||
pub mod aabb; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this probably makes mores sense as aabb_gizmo
or something here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, but I was thinking in the future: Should things added to the tools be all behind feature flags so the user can easily disable then? Or maybe we should do the DevToolPlugin
into a PluginGroup
to make it a easy thing to do? 🤔
Unless I'm missing something, I think this is blocked by the fact that |
I think we are missing imports on cargo, we might want to add to the imports bevy_render and bevy_color (and other needed crates) |
Adding |
Understood. Looks like we are using it in render to add tests when dev_tools feature is on, and even use some types from it, what a pain |
You added a new example but didn't add metadata for it. Please update the root Cargo.toml file. |
In the spirit of Cart's comment on the main bevy_dev_tools PR, why is As an example for why this jumps out to me as not clear cut: Couldn't you build a game that has I'd say you all know what you're doing and this is a good idea :), but it could be useful to document strong reason this is a good move in separate PRs that do the change, for posterity, etc. It would also help make sure each PR is directly thinking back to Cart's comment to make sure it's not a grab bag 🤔 |
Great question! My stance on "what is bevy_dev_tools":
The fact that users could use these tools in a final product doesn't negate the fact that they're primarily going to be used for development: there's nothing stopping you from enabling dev tools in your final build but only turning on the key features you need :) |
I guess in my hypothetical example, if the real game needs the Aabb gizmo for an end-user mechanic (again, hypothetical, maybe too contrived), then the game dev can still use the Out of interest, is there any reason that stuff has to live inside |
Isn't I would prefer a |
Well, the initial proposal was to have a canonical place to put the tools that we we'll for sure do in our way to make the editor happen. I think the |
@@ -35,10 +38,12 @@ pub mod ci_testing; | |||
pub struct DevToolsPlugin; | |||
|
|||
impl Plugin for DevToolsPlugin { | |||
fn build(&self, _app: &mut App) { | |||
fn build(&self, app: &mut App) { | |||
app.add_plugins(AabbGizmoPlugin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, for now, we should hide it behind a feature and change it later when we create some other abstraction for toggling specific tools
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. We have to create this abstraction soon, though, the amount of created features can be very high if we don't handle with care.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do DevToolsPlugin
into a PluginGroup
, to make it easy disable and enable things, but I'm not sure how this will play with DefaultPlugins
though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've thought about it too, but wouldn't it then be impossible to change dev tools during runtime? I also thought about making a config as a resource but there might be a better way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is a way at disabling this at runtime right now, at least not in the way we are currently doing
we add plugins to the app after all, is there a way to currently disabling a plugin, adding a plugin, or even adding systems at runtime right now? If we want, we can at least make it into a group now and mitigate the effects I guess, at least while we don't have the runtime tool manager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can't add/remove plugins at runtime (see #11083), but maybe we could achieve something without plugins? I think we should create an issue regarding this to decide which direction we want to go for now
Once some dev tool abstraction is added (i.e. #12427) I'll update this PR. |
Objective
Done as part of #12351.
Solution
Moved the
aabb
module out ofbevy_gizmos
and intobevy_dev_tools
.Migration Guide
Aabb gizmos are no longer used through
GizmoPlugin
. You must enable thebevy_dev_tools
feature instead.