You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a plugin that loaded before DefaultPlugins.
Everything worked. Even the Gizmos (the default group is loaded by something else later).
I tried moving to my own GizmoConfigGroup.
I did everything like the 3d gizmo demo, but they would not render.
After an embarrassing amount of time i figured out, that i had to move the plugin initialization down one line.
What went wrong
it seems you have moved the initialization of the gizmo renderer into GizmoPlugin::build now, which is better, because the plugin is probably loaded using DefaultPlugins and therefore in the correct order, but someone like me could still mess it up. bevy_gizmos/src/lib.rsGizmoPlugin::build
letOk(render_app) = self.get_sub_app_mut(RenderApp)else{// this should probably panic!returnself;};// this is the expected (and needed if you do not have your own renderer) behaviour
render_app.add_systems(ExtractSchedule,extract_gizmo_data::<T>);
What should happen
The app should panic! (or at least warn!) if it can not find the renderer.
Proposed Solution
you seem to have refactored it in the main branch, but you still dont do it like you do for the other plugins right under it
#[cfg(feature = "bevy_sprite")]if app.is_plugin_added::<bevy_sprite::SpritePlugin>(){
app.add_plugins(pipeline_2d::LineGizmo2dPlugin);}else{
bevy_utils::tracing::warn!("bevy_sprite feature is enabled but bevy_sprite::SpritePlugin was not detected. Are you sure you loaded GizmoPlugin after SpritePlugin?");}
for `release-0.13.2`
The easiest solution would be to just panic if bevy was build with the renderer and it was not found,
but that would mean you could not use this function if you use a different Renderer and you build bevy with its own.
The better solution would probably be to just split the function into init_gizmo_group_without_renderer and init_gizmo_group_and_renderer (so old users get a compilation error and need to decide which version they need, or just use the old version and let people with a custom renderer deal with it, since it would panic for them).
this also affects insert_gizmo_group
The text was updated successfully, but these errors were encountered:
Bevy version
0.13.2
What you did
I had a plugin that loaded before
DefaultPlugins
.Everything worked. Even the Gizmos (the default group is loaded by something else later).
I tried moving to my own
GizmoConfigGroup
.I did everything like the 3d gizmo demo, but they would not render.
After an embarrassing amount of time i figured out, that i had to move the plugin initialization down one line.
What went wrong
it seems you have moved the initialization of the gizmo renderer into GizmoPlugin::build now, which is better, because the plugin is probably loaded using DefaultPlugins and therefore in the correct order, but someone like me could still mess it up.
bevy_gizmos/src/lib.rs
GizmoPlugin::build
for `release-0.13.2`
bevy_gizmos/src/lib.rs
App::init_gizmo_group
What should happen
The app should panic! (or at least warn!) if it can not find the renderer.
Proposed Solution
you seem to have refactored it in the
main
branch, but you still dont do it like you do for the other plugins right under itfor `release-0.13.2`
The easiest solution would be to just panic if bevy was build with the renderer and it was not found,
but that would mean you could not use this function if you use a different Renderer and you build bevy with its own.
The better solution would probably be to just split the function into
init_gizmo_group_without_renderer
andinit_gizmo_group_and_renderer
(so old users get a compilation error and need to decide which version they need, or just use the old version and let people with a custom renderer deal with it, since it would panic for them).this also affects
insert_gizmo_group
The text was updated successfully, but these errors were encountered: