Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add load_untyped to LoadContext #10526

Merged
merged 1 commit into from
Nov 15, 2023
Merged

Add load_untyped to LoadContext #10526

merged 1 commit into from
Nov 15, 2023

Conversation

Testare
Copy link
Contributor

@Testare Testare commented Nov 13, 2023

Objective

Give us the ability to load untyped assets in AssetLoaders.

Solution

Basically just copied the code from load, but used asset_server.load_untyped instead internally.

Changelog

Added load_untyped method to LoadContext

@Testare
Copy link
Contributor Author

Testare commented Nov 13, 2023

Failing test doesn't seem to be related to this change.

Have also via Cargo.toml [patch] have been able to confirm it works just fine for me. Please consider this for a 12.x release =]

@Testare Testare marked this pull request as ready for review November 13, 2023 02:10
@alice-i-cecile alice-i-cecile added A-Assets Load files from disk to use for things like images, models, and sounds C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Nov 14, 2023
@alice-i-cecile alice-i-cecile added this to the 0.12.1 milestone Nov 14, 2023
Copy link
Member

@cart cart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on board for this / the code is correct, but I do wonder about the utility of exposing this to AssetLoaders, as it would imply you are loading handles in assets that must later be resolved to the "final handle" by consumers of the asset.

@cart cart added this pull request to the merge queue Nov 15, 2023
Merged via the queue into bevyengine:main with commit 675aac9 Nov 15, 2023
24 checks passed
@Testare
Copy link
Contributor Author

Testare commented Nov 15, 2023

Thank you for taking the time to review/approve and merge!

If you want to know, my use case is I have custom ".bam(.txt)" files, or "Bevy Asset Manifest" assets. They are simple lists of different assets I want loaded together. In this case, the BAM asset itself doesn't really care about what the thing is that is being loaded, just that it is loaded. This triggers the asset event listeners that DO care about what is loaded (I have some assets that essentially only exist to be loaded and fed into a common resource), as well as allowing me to specify a bundle of assets to be "preloaded."

cart pushed a commit that referenced this pull request Nov 30, 2023
# Objective

Give us the ability to load untyped assets in AssetLoaders.

## Solution

Basically just copied the code from `load`, but used
`asset_server.load_untyped` instead internally.

## Changelog

Added `load_untyped` method to `LoadContext`
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

Give us the ability to load untyped assets in AssetLoaders.

## Solution

Basically just copied the code from `load`, but used
`asset_server.load_untyped` instead internally.

## Changelog

Added `load_untyped` method to `LoadContext`
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 C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants