modelio-rs 0.2.1

Safe Rust bindings for Apple's ModelIO framework — assets, meshes, materials, lights, cameras, voxels, textures, and animation on macOS
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use modelio::prelude::*;

fn main() -> modelio::Result<()> {
    let allocator = MeshBufferDataAllocator::new()?;
    let zone = allocator.new_default_zone(64)?;
    let buffer = allocator
        .as_mesh_buffer_allocator()
        .new_buffer_with_data(&[1, 2, 3, 4], MeshBufferType::Vertex)?;
    let map = buffer.map()?;

    println!("zone capacity={} bytes={:?}", zone.capacity(), map.bytes());
    Ok(())
}