Skip to main content

Crate emote_psb

Crate emote_psb 

Source
Expand description

§emote-psb

Serde-based serialization and deserialization library for the E-mote PSB/MDF binary data format.

§Overview

E-mote PSB (.psb, .scn) is a proprietary binary format used by E-mote animation data. MDF (.mdf) is a zlib-compressed wrapper around a PSB file.

§Reading a PSB file

use emote_psb::{psb::read::PsbFile, value::PsbValue};
use std::{fs::File, io::BufReader};

let file = BufReader::new(File::open("sample.psb").unwrap());
let mut psb = PsbFile::open(file).unwrap();
let root: PsbValue = psb.deserialize_root().unwrap();

§Writing a PSB file

use emote_psb::{psb::write::PsbWriter, value::PsbValue};
use std::{fs::File, io::BufWriter};

let root = PsbValue::Null;
let out = BufWriter::new(File::create("out.psb").unwrap());
let writer = PsbWriter::new(3, false, &root, out).unwrap();
writer.finish().unwrap();

Modules§

mdf
MDF (compressed PSB) reading and writing support.
psb
PSB/MDF reading and writing support.
value
PSB value types and serde serialization/deserialization.

Constants§

PSB_MDF_SIGNATURE
MDF (compressed PSB) file signature ("mdf" as a little-endian u32).
PSB_SIGNATURE
PSB file signature ("PSB" as a little-endian u32).