1 unstable release

Uses new Rust 2024

0.1.0 Feb 26, 2025

#1341 in Game dev

Download history 66/week @ 2025-02-20 142/week @ 2025-02-27 6/week @ 2025-03-06 4/week @ 2025-03-13 16/week @ 2025-03-27 89/week @ 2025-04-03

110 downloads per month
Used in bevy_gaussian_splatting

MIT/Apache

33KB
154 lines

File Asset Plugin for Bevy

This plugin registers an asset source under the "file" scheme which loads assets directly from arbitrary paths (both relative to the working directory and absolute).

If the file does not exist at the given path, the reader returns a NotFound error, so that Bevy’s asset server can fall back to other methods.

Example Usage

use bevy::prelude::*;
use bevy_file_asset::FileAssetPlugin;

let mut app = App::new();
// Register the file asset source before adding the DefaultPlugins.
app.add_plugins((FileAssetPlugin::default(), DefaultPlugins));

bevy_file_asset 🧩

crates.io

bevy asset loader supporting files outside of the asset folder

minimal example

use bevy::prelude::*;
use bevy_file_asset::FileAssetPlugin;

fn main() {
    App::new()
        .add_plugins((
            FileAssetPlugin,
            DefaultPlugins,
        ))
        .add_systems(Startup, setup)
        .run();
}

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn(Camera2d::default());

    let image = asset_server.load("file://docs/image.png");
    commands.spawn(Sprite {
        image,
        ..Default::default()
    });
}

compatible bevy versions

bevy_args bevy
0.1 0.15

Dependencies

~66–105MB
~2M SLoC