mirror of
https://github.com/bevyengine/bevy.git
synced 2026-07-01 00:05:45 -04:00
d196050db1
# Objective - Previously, asset processors needed to be **fully specified**. This meant writing met files by hand was incredibly cumbersome. - In addition, using `core::any::type_name` is generally undesirable since it is only intended for debugging. ## Solution - Require `TypePath` impl on `AssetLoader`, `AssetTransformer`, `AssetSaver`, and `AssetProcessor`. - Register loaders and processors by their `TypePath::type_path`. This makes the path format stable. - Additionally register the processors by their `TypePath::short_type_path`, and ensure there are no other processors with the same `short_type_path`. If a user tries to use an ambiguous short type path, we list out all full type paths. Note: I left doing this with asset loaders as a future PR. There's more complexity there (since we have to deal with pre-registering asset loaders), and this seems like the bigger "bang for our buck". ## Testing - I ran the asset_processing example. No change. - I changed the asset processing example to use the short type path. It still behaved as expected. - I created a new AssetTransformer in `asset_processing::sneaky::CoolTextTransformer` and a new processor that looked identical to the regular one (but using the sneaky transformer). It printed an error, listing out the full paths of both processors! --------- Co-authored-by: Carter Anderson <mcanders1@gmail.com>