bevy/examples/asset
thepackett 76682fdcb7
AssetSaver and AssetTransformer split (#11260)
# Objective
One of a few Bevy Asset improvements I would like to make: #11216.

Currently asset processing and asset saving are handled by the same
trait, `AssetSaver`. This makes it difficult to reuse saving
implementations and impossible to have a single "universal" saver for a
given asset type.

## Solution
This PR splits off the processing portion of `AssetSaver` into
`AssetTransformer`, which is responsible for transforming assets. This
change involves adding the `LoadTransformAndSave` processor, which
utilizes the new API. The `LoadAndSave` still exists since it remains
useful in situations where no "transformation" of the asset is done,
such as when compressing assets.

## Notes:
As an aside, Bikeshedding is welcome on the names. I'm not entirely
convinced by `AssetTransformer`, which was chosen mostly because
`AssetProcessor` is taken. Additionally, `LoadTransformSave` may be
sufficient instead of `LoadTransformAndSave`.


---

## Changelog
### Added 
- `AssetTransformer` which is responsible for transforming Assets.
- `LoadTransformAndSave`, a `Process` implementation.
### Changed
- Changed `AssetSaver`'s responsibilities from processing and saving to
just saving.
- Updated `asset_processing` example to use new API.
- Old asset .meta files regenerated with new processor.
2024-01-26 20:20:58 +00:00
..
processing AssetSaver and AssetTransformer split (#11260) 2024-01-26 20:20:58 +00:00
asset_decompression.rs Added Method to Allow Pipelined Asset Loading (#10565) 2023-11-16 17:47:31 +00:00
asset_loading.rs Restore brightness in the remaining three examples after exposure PR (#11389) 2024-01-17 17:10:21 +00:00
custom_asset.rs Remove unnecessary ResMut in examples (#10879) 2023-12-05 15:42:32 +00:00
custom_asset_reader.rs fix example custom_asset_reader on wasm (#10574) 2023-11-16 01:50:13 +00:00
hot_asset_reloading.rs Restore brightness in the remaining three examples after exposure PR (#11389) 2024-01-17 17:10:21 +00:00