Crates.io | live2d-parser |
lib.rs | live2d-parser |
version | 0.1.3 |
created_at | 2025-04-01 07:50:47.302324+00 |
updated_at | 2025-04-05 00:23:54.854321+00 |
description | The pure rust parser for Live2D's `*.model.json` and `*.moc` |
homepage | |
repository | https://github.com/oovm/live2d-unpacker |
max_upload_size | |
id | 1614526 |
size | 957,758 |
A Rust library for parsing Live2D model files, without any ffi calls.
Supports Cubism 2.0/3.0/4.0/4.0 formats.
use live2d_parser::cubism_v1::Moc;
let moc = unsafe { Moc::new(include_bytes!("BCY.moc"))? };
let mut json = File::create("BCY.json")?;
json.write_all(serde_json::to_string_pretty(&moc)?.as_bytes())?;
use live2d_parser::cubism_v3::Moc3;
let moc = unsafe { Moc3::new(include_bytes!("mao_pro.moc3"))? };
let mut json = File::create("mao_pro.json")?;
json.write_all(serde_json::to_string_pretty(&moc)?.as_bytes())?;