bevy/crates
Carter Anderson 79da6fd02f AssetMetaMode (#10623)
# Objective

Fixes #10157

## Solution

Add `AssetMetaCheck` resource which can configure when/if asset meta
files will be read:

```rust
app
  // Never attempts to look up meta files. The default meta configuration will be used for each asset.
  .insert_resource(AssetMetaCheck::Never)
  .add_plugins(DefaultPlugins)
```


This serves as a band-aid fix for the issue with wasm's
`HttpWasmAssetReader` creating a bunch of requests for non-existent
meta, which can slow down asset loading (by waiting for the 404
response) and creates a bunch of noise in the logs. This also provides a
band-aid fix for the more serious issue of itch.io deployments returning
403 responses, which results in full failure of asset loads.

If users don't want to include meta files for all deployed assets for
web builds, and they aren't using meta files at all, they should set
this to `AssetMetaCheck::Never`.

If users do want to include meta files for specific assets, they can use
`AssetMetaCheck::Paths`, which will only look up meta for those paths.

Currently, this defaults to `AssetMetaCheck::Always`, which makes this
fully non-breaking for the `0.12.1` release. _**However it _is_ worth
discussing making this `AssetMetaCheck::Never` by default**_, given that
I doubt most people are using meta files without the Asset Processor
enabled. This would be a breaking change, but it would make WASM / Itch
deployments work by default, which is a pretty big win imo. The downside
is that people using meta files _without_ processing would need to
manually enable `AssetMetaCheck::Always`, which is also suboptimal.

When in `AssetMetaCheck::Processed`, the meta check resource is ignored,
as processing requires asset meta files to function.

In general, I don't love adding this knob as things should ideally "just
work" in all cases. But this is the reality of the current situation.

---

## Changelog

- Added `AssetMetaCheck` resource, which can configure when/if asset
meta files will be read
2023-11-29 16:55:39 -08:00
..
bevy_a11y Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_animation Fix animations resetting after repeat count (#10540) 2023-11-29 16:42:51 -08:00
bevy_app Wait until FixedUpdate can see events before dropping them (#10077) 2023-11-29 16:55:21 -08:00
bevy_asset AssetMetaMode (#10623) 2023-11-29 16:55:39 -08:00
bevy_audio Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_core Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_core_pipeline Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_derive Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_diagnostic Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_dylib Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_dynamic_plugin Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_ecs Wait until FixedUpdate can see events before dropping them (#10077) 2023-11-29 16:55:21 -08:00
bevy_ecs_compile_fail_tests Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
bevy_encase_derive Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_gilrs Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_gizmos Fix float precision issue in the gizmo shader (#10408) 2023-11-29 16:44:26 -08:00
bevy_gltf Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_hierarchy Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_input Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_internal Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_log Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_macro_utils Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_macros_compile_fail_tests bevy_derive: Fix #[deref] breaking other attributes (#9551) 2023-08-28 17:36:18 +00:00
bevy_math Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_mikktspace Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_pbr Non uniform transmission samples (#10674) 2023-11-29 16:53:10 -08:00
bevy_ptr Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_reflect Fix issue with Option serialization (#10705) 2023-11-29 16:53:25 -08:00
bevy_reflect_compile_fail_tests Improve TypeUuid's derive macro error messages (#9315) 2023-10-02 12:42:01 +00:00
bevy_render Fix shader import hot reloading on windows (#10502) 2023-11-29 16:41:02 -08:00
bevy_scene Use handles for queued scenes in SceneSpawner (#10619) 2023-11-29 16:52:11 -08:00
bevy_sprite Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_tasks Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_text Improved Text Rendering (#10537) 2023-11-29 16:44:14 -08:00
bevy_time Wait until FixedUpdate can see events before dropping them (#10077) 2023-11-29 16:55:21 -08:00
bevy_transform Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_ui Fix typo in resolve_outlines_system (#10730) 2023-11-29 16:53:56 -08:00
bevy_utils Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_window Release 0.12 (#10362) 2023-11-04 17:24:23 +00:00
bevy_winit don't run update before window creation in winit (#10741) 2023-11-29 16:54:08 -08:00