MCPcopy Index your code
hub / github.com/AmionSky/bevy_obj

github.com/AmionSky/bevy_obj @v0.19.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.19.0 ↗ · + Follow
43 symbols 65 edges 6 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

bevy_obj

Crates.io

Wavefront OBJ mesh asset loader plugin for the Bevy engine.

Usage

Add the crate as a dependency:

Major and Minor version number should match bevy version.

[dependencies]
bevy = "0.19.0"
bevy_obj = "0.19.0"

Add the plugin:

use bevy::prelude::*;
use bevy_obj::ObjPlugin;

fn main() {
    App::new()
        .add_plugins((DefaultPlugins, ObjPlugin))
        .run();
}

Load an .obj file:

fn example_startup_system(asset_server: Res<AssetServer>) {
    // Load it as a singular mesh
    let mesh_handle = asset_server.load::<Mesh>("example.obj");

    // Load it as a scene with limited .mtl material support
    let scene_handle = asset_server.load::<Scene>("example.obj");

    // Or let bevy infer the type
    let mesh = Mesh3d(asset_server.load("example.obj"));
    let scene = SceneRoot(asset_server.load("example.obj"));
}

Settings

You can use load_with_settings() to modify some loader settings.

fn example_startup_system(asset_server: Res<AssetServer>) {
    // Load the model with flat normals
    let scene = SceneRoot(asset_server.load_with_settings(
        "example.obj",
        |settings: &mut bevy_obj::ObjSettings| {
            settings.force_compute_normals = true;
            settings.prefer_flat_normals = true;
        },
    ));
}

License

Licensed under either of

  • MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
  • Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)

at your option.

Core symbols most depended-on inside this repo

apply_f32
called by 6
src/scene.rs
load
called by 4
src/mesh.rs
load
called by 2
src/scene.rs
resolve_path
called by 2
src/scene.rs
load_texture
called by 2
src/scene.rs
to_bevy_mesh
called by 2
src/util.rs
load_materials
called by 1
src/scene.rs
default_material
called by 1
src/scene.rs

Shape

Function 25
Class 9
Method 7
Enum 2

Languages

Rust100%

Modules by API surface

src/scene.rs15 symbols
examples/viewer.rs11 symbols
examples/cubes.rs6 symbols
src/mesh.rs5 symbols
src/util.rs3 symbols
src/lib.rs3 symbols

For agents

$ claude mcp add bevy_obj \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact