Function easy_gltf::load

source ·
pub fn load<P>(path: P) -> Result<Vec<Scene>, Box<dyn Error + Send + Sync>>
where P: AsRef<Path>,
Expand description

Load scenes from path to a glTF 2.0.

Note: You can use this function with either a Gltf (standard glTF) or Glb (binary glTF).

§Example

let scenes = easy_gltf::load("tests/cube.glb").expect("Failed to load glTF");
println!("Scenes: #{}", scenes.len()); // Output "Scenes: #1"
let scene = &scenes[0]; // Retrieve the first and only scene
println!("Cameras: #{}", scene.cameras.len());
println!("Lights: #{}", scene.lights.len());
println!("Models: #{}", scene.models.len());