13个版本

0.0.13 2024年7月18日
0.0.12 2024年3月19日
0.0.6 2024年1月22日
0.0.3 2023年11月17日

#23数据格式

Download history • Rust 包仓库 6/week @ 2024-05-03 • Rust 包仓库 7/week @ 2024-05-10 • Rust 包仓库 13/week @ 2024-05-17 • Rust 包仓库 11/week @ 2024-05-24 • Rust 包仓库 13/week @ 2024-05-31 • Rust 包仓库 17/week @ 2024-06-07 • Rust 包仓库 15/week @ 2024-06-14 • Rust 包仓库 12/week @ 2024-06-21 • Rust 包仓库 5/week @ 2024-06-28 • Rust 包仓库 7/week @ 2024-07-05 • Rust 包仓库 102/week @ 2024-07-12 • Rust 包仓库 43/week @ 2024-07-19 • Rust 包仓库 30/week @ 2024-07-26 • Rust 包仓库 51/week @ 2024-08-02 • Rust 包仓库 48/week @ 2024-08-09 • Rust 包仓库 49/week @ 2024-08-16 • Rust 包仓库

183 每月下载次数
用于 4 crates

MIT/Apache

245KB
6.5K SLoC

gltf_kun

基于图的 glTF 处理库。使用 petgraph 创建可遍历的glTF文档图。

用法

use gltf_kun::graph::{Graph, GraphNodeWeight, gltf::document::GltfDocument};

let mut graph = Graph::default();

// Create a new glTF document within the graph.
let doc = GltfDocument::new(&mut graph);

// Create a new scene.
// This `scene` variable is just a wrapper around a u32 index into the graph,
// making it cheap to copy and pass around.
let mut scene = doc.create_scene(&mut graph);

// To read or write data, we need to get the weight.
let weight = scene.get_mut(&mut graph);
weight.name = Some("My Scene".to_string());

// Create a glTF node and add it to the scene.
let mut node = doc.create_node(&mut graph);
scene.add_node(&mut graph, node);

// Iterate over all scenes in the document, printing their names.
doc.scenes(&graph).iter().for_each(|scene| {
    let weight = scene.get(&graph);
    println!("Scene name: {:?}", weight.name);
});

use gltf_kun::{extensions::DefaultExtensions, io::format::glb::GlbExport};

// Export the document to a GLB byte array.
let glb = GlbExport::<DefaultExtensions>::export(&mut graph, &doc).ok();

依赖关系

~13MB
~273K SLoC