| Crates.io | ltk_mesh |
| lib.rs | ltk_mesh |
| version | 0.4.0 |
| created_at | 2025-09-28 10:14:57.973524+00 |
| updated_at | 2025-12-27 18:27:52.674996+00 |
| description | Mesh parsing and structures for League Toolkit |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1858199 |
| size | 65,393 |
Rust library for parsing, editing, and writing League of Legends file formats
Documentation β’ Crates.io β’ Changelog
.wad.client asset containers.tex and .dds formats.skn) and static (.scb/.sco) meshes.skl) and animations (.anm).bin configuration files.mapgeo environment assetsAdd the umbrella crate to your project:
[dependencies]
league-toolkit = { version = "0.2", features = ["wad", "mesh", "texture"] }
Or use individual crates for a smaller dependency footprint:
[dependencies]
ltk_wad = "0.2"
ltk_texture = "0.4"
ltk_mesh = "0.3"
use std::fs::File;
use ltk_wad::Wad;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let file = File::open("assets.wad.client")?;
let mut wad = Wad::mount(file)?;
println!("Archive contains {} files", wad.chunks().len());
// Decode a specific chunk
let (mut decoder, chunks) = wad.decode();
for chunk in chunks.values().take(5) {
let data = decoder.load_chunk_decompressed(chunk)?;
println!("Chunk {:016x}: {} bytes", chunk.path_hash(), data.len());
}
Ok(())
}
use ltk_texture::Tex;
use std::io::Cursor;
let tex = Tex::from_reader(&mut cursor)?;
let surface = tex.decode_mipmap(0)?;
let image = surface.into_rgba_image()?;
image.save("output.png")?;
use ltk_mesh::SkinnedMesh;
use std::fs::File;
let mesh = SkinnedMesh::from_reader(&mut File::open("champion.skn")?)?;
println!("Vertices: {}", mesh.vertex_buffer().vertex_count());
println!("Submeshes: {}", mesh.ranges().len());
use ltk_meta::{BinTree, BinTreeObject, value::*};
// Read
let tree = BinTree::from_reader(&mut file)?;
for (hash, object) in &tree.objects {
println!("Object 0x{:08x}", hash);
}
// Create
let tree = BinTree::builder()
.dependency("shared/data.bin")
.object(
BinTreeObject::builder(0x12345678, 0xABCDEF00)
.property(0x1111, I32Value(42))
.build()
)
.build();
| Crate | Description | Formats |
|---|---|---|
league-toolkit |
Umbrella crate (feature-gated re-exports) | β |
ltk_wad |
WAD archive reading/writing | .wad.client |
ltk_texture |
Texture decoding/encoding | .tex, .dds |
ltk_mesh |
Skinned & static mesh parsing | .skn, .scb, .sco |
ltk_anim |
Skeleton & animation formats | .skl, .anm |
ltk_meta |
Property bin files | .bin |
ltk_ritobin |
Human-readable bin format | ritobin text |
ltk_mapgeo |
Map environment geometry | .mapgeo |
ltk_file |
File type detection | β |
ltk_hash |
Hash functions (FNV-1a, ELF) | β |
ltk_shader |
Shader path utilities | β |
ltk_primitives |
Geometric primitives | β |
ltk_io_ext |
I/O extensions (internal) | β |
Each crate lives under crates/<name>.
The league-toolkit umbrella crate uses feature flags to control which subsystems are included:
| Feature | Enables | Default |
|---|---|---|
anim |
ltk_anim |
β |
file |
ltk_file |
β |
mesh |
ltk_mesh |
β |
meta |
ltk_meta |
β |
primitives |
ltk_primitives |
β |
texture |
ltk_texture |
β |
wad |
ltk_wad |
β |
hash |
ltk_hash |
β |
serde |
Serde support (where available) | β |
For a minimal build, disable defaults and opt-in selectively:
[dependencies]
league-toolkit = { version = "0.2", default-features = false, features = ["wad"] }
intel-texBC1/BC3 texture encoding requires the optional intel-tex feature on ltk_texture:
[dependencies]
league-toolkit = { version = "0.2", features = ["texture"] }
ltk_texture = { version = "0.4", features = ["intel-tex"] }
Prerequisites: Rust stable toolchain
# Build all crates
cargo build
# Run tests
cargo test
# Build documentation
cargo doc --open
league-toolkit/
βββ crates/
β βββ league-toolkit/ # Umbrella crate
β βββ ltk_wad/ # WAD archives
β βββ ltk_texture/ # Textures
β βββ ltk_mesh/ # Meshes
β βββ ltk_anim/ # Animation
β βββ ltk_meta/ # Property bins
β βββ ltk_ritobin/ # Ritobin text format
β βββ ltk_mapgeo/ # Map geometry
β βββ ltk_file/ # File detection
β βββ ltk_hash/ # Hashing
β βββ ltk_shader/ # Shader utilities
β βββ ltk_primitives/ # Primitives
β βββ ltk_io_ext/ # I/O extensions
βββ docs/
βββ LTK_GUIDE.md # Usage guide
This repository uses Release-plz for automated versioning and publishing:
main trigger Release-plz to open a release PRLicensed under either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Made with β€οΈ by the LeagueToolkit community