bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.4k stars 3.59k forks source link

Disabling bevy_*_picking_backend does not disable backends. #16469

Closed andriyDev closed 3 days ago

andriyDev commented 3 days ago

In my project I want to disable the bevy_sprite_picking_backend feature and write my own (I want to fork #16388). However adding the following to my Cargo.toml does not work:

bevy = { version = "0.15.0-rc.3", default-features = false, features = [
  # Default features
  "android-game-activity",
  "android-game-activity",
  "android_shared_stdcxx",
  "animation",
  "bevy_asset",
  "bevy_audio",
  "bevy_color",
  "bevy_core_pipeline",
  "bevy_gilrs",
  "bevy_gizmos",
  "bevy_gltf",
  # "bevy_mesh_picking_backend",
  "bevy_pbr",
  "bevy_picking",
  "bevy_remote",
  "bevy_render",
  "bevy_scene",
  "bevy_sprite",
  # "bevy_sprite_picking_backend",
  "bevy_state",
  "bevy_text",
  "bevy_ui",
  # "bevy_ui_picking_backend",
  "bevy_winit",
  "custom_cursor",
  "default_font",
  "hdr",
  "multi_threaded",
  "png",
  "smaa_luts",
  "sysinfo_plugin",
  "tonemapping_luts",
  "vorbis",
  "webgl2",
  "x11",
] }

My PreUpdate graph still includes the sprite and ui backends. The mesh backend isn't present, but that's just because the MeshPickingPlugin is intentionally not added by default.

Image

It looks like the default features for bevy_sprite sets bevy_sprite_picking_backend. bevy then has a feature bevy_sprite that enables that crate which by default uses the picking backend. The bevy_sprite_picking_backend feature in bevy then does nothing since bevy_sprite itself sets this feature.

A similar story exists for bevy_ui_picking_backend and bevy_mesh_picking_backend.

andriyDev commented 3 days ago

Related but different issue: #16472