Skip to content

Make asset processors take an explicit name instead of using its type path. - #26433

Open
andriyDev wants to merge 2 commits into
bevyengine:mainfrom
andriyDev:named-processors
Open

andriyDev wants to merge 2 commits into
bevyengine:mainfrom
andriyDev:named-processors

Conversation

@andriyDev

Copy link
Copy Markdown
Contributor

Objective

  • Asset processors are currently looked up by their TypePath. This means that processors types are not reusable. Once you create a processor of a particular type, you'll need to create a new type altogether to configure things differently.
    • This prevents a processor type to be used "dynamically". For example, you can't define a processor using a scripting language: you'd need to create a brand new type in Rust to do the processing.
    • For another example, LoadTransformAndSave must be generic, so that each combination of AssetLoader, AssetTransformer, and AssetSaver is a unique type (as opposed to having one non-generic type that is dynamically assembled). This prevents us from having an AssetTransformer/AssetSaver registery and then assembling the appropriate processor entirely from the meta file.

Solution

  • When registering a processor, you must give a name to your processor.
  • Meta files now try to lookup the processor by its name first.
    • To allow for migration, we continue to support type paths for now. This should be deleted after 0.21.

Testing

  • Ran the asset processing example and it works!

@andriyDev andriyDev added A-Assets Load files from disk to use for things like images, models, and sounds D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward AI-Free Does not disclose the use of AI labels Nov 6, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Assets Nov 6, 2026
@andriyDev andriyDev added C-Bug An unexpected or incorrect behavior C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Nov 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Assets Load files from disk to use for things like images, models, and sounds AI-Free Does not disclose the use of AI C-Bug An unexpected or incorrect behavior C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

1 participant