| Crates.io | bevy_ufbx |
| lib.rs | bevy_ufbx |
| version | 0.17.0 |
| created_at | 2025-09-23 18:55:36.547444+00 |
| updated_at | 2026-01-04 20:08:59.97207+00 |
| description | FBX asset loader for Bevy using the ufbx library |
| homepage | |
| repository | https://github.com/FizzWizzleDazzle/bevy_ufbx |
| max_upload_size | |
| id | 1851970 |
| size | 259,122 |
A Bevy plugin for loading FBX files using the ufbx library.
Add to your Cargo.toml:
[dependencies]
bevy_ufbx = "0.17"
bevy = "0.17"
The crate minor version matches Bevy's version.
use bevy::prelude::*;
use bevy_ufbx::FbxPlugin;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(FbxPlugin)
.run();
}
use bevy::prelude::*;
use bevy_ufbx::{Fbx, FbxAssetLabel};
fn load_fbx(
mut commands: Commands,
asset_server: Res<AssetServer>,
) {
// Load the entire FBX file
let fbx_handle = asset_server.load::<Fbx>("models/character.fbx");
// Or load specific sub-assets with labels
let scene = asset_server.load::<Scene>("models/character.fbx#Scene0");
let mesh = asset_server.load::<Mesh>("models/character.fbx#Mesh0");
let material = asset_server.load::<StandardMaterial>("models/character.fbx#Material0");
// Spawn the scene
commands.spawn(SceneRoot(scene));
}
use bevy::prelude::*;
use bevy_ufbx::FbxLoaderSettings;
fn load_with_settings(asset_server: Res<AssetServer>) {
asset_server.load_with_settings::<Fbx, FbxLoaderSettings>(
"models/environment.fbx",
|settings: &mut FbxLoaderSettings| {
settings.load_cameras = false;
settings.load_lights = false;
settings.convert_coordinates = true;
}
);
}
The plugin uses labeled sub-assets to allow loading specific parts of an FBX file:
Scene{N} - Scene hierarchy (N is the scene index)Node{N} - Individual nodesMesh{N} - Mesh dataMaterial{N} - MaterialsTexture{N} - TexturesAnimation{N} - AnimationsSkin{N} - Skinning dataDefaultMaterial - Default material when none is specifiedSee the examples/ directory for more detailed usage examples.
Licensed under either of:
at your option.
Contributions are welcome! Please feel free to submit a Pull Request.