bevyengine / bevyengine/bevy

Loading assets is ambiguous between the source asset and the processed asset.

Open
#21,269 3 comments 0 reactions 0 assignees View on GitHub
A-Assets C-Refinement D-Complex S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

Imagine an asset in your `assets` directory at path `my_thingy.sphere`.

```rust
struct SphereAsset {
radius: f32
}
```
We also create an asset processor to convert this `SphereAsset` into a `Mesh`. Now consider we have two assets that want to load this asset:

```rust
struct BooleanOperator {
sphere1: Handle,
sphere2: Handle,
}

struct Collider {
mesh: Handle,
}
```

Inside the loader of these, they will both try to load "my_thingy.sphere", except with different types! One of these is not valid, and will fail when loading (even during processing).

This is even worse with one-to-many asset processing, where the original path may no longer even exist (since the one asset may have been broken into several pieces).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.