Expand description
The .ssab / .ssqb binary format — SpriteStudio’s on-disk runtime data.
This crate is the schema, not a library of behaviour: almost everything under
ssab and ssqb is FlatBuffers code generated from fbs/ssab.fbs and
fbs/ssqb.fbs. It sits between the two halves of the SDK — ssconverter writes
these binaries, ssruntime reads them zero-copy.
| Module | Root table | Holds |
|---|---|---|
ssab | SsAnimeBinary | animations, parts, keyframes, cell maps, effects |
ssqb | SsSequenceBinary | sequence packs (.ssqe) |
§Reading (default)
The default feature set is read-only and zero-copy, which is what a Player wants: accessors borrow directly out of the mapped buffer, with no parse step and no allocation.
use ssab::ssab::ss::format::root_as_ss_anime_binary;
let bytes = std::fs::read("character.ssab")?;
let binary = root_as_ss_anime_binary(&bytes)?;
println!("{}", binary.name());
for anime in binary.animations() {
println!(" {} @ {} fps", anime.name(), anime.fps());
}§Writing (converter)
Enabling converter selects the modules generated with the FlatBuffers object API
(--gen-object-api), which add owned …T structs that can be built up in memory and
packed back into a buffer. Only tools that emit data need this; it implies std.
§Feature flags
| Feature | Purpose |
|---|---|
std (default) | std support in flatbuffers. Disable for no_std Players. |
converter | Read/write object API (SsAnimeBinaryT and friends). Implies std. |
§Validation
root_as_* verifies the buffer; the _unchecked variants do not. ssruntime
deliberately uses the unchecked path in the playback hot loop, which is why
validating untrusted assets is the Player’s responsibility.
§Regenerating
The Rust modules are generated output — edit fbs/*.fbs and re-run
scripts/generate.sh (or .ps1), which needs flatc on PATH. Never hand-edit
src/runtime/ or src/converter/.
See the schema documentation for the field-by-field design spec.
Modules§
Constants§
- NO_
CURVE Keyframes.curvefor a key that reads neither a curve nor an easing rate.- NO_KEYS
- A
PartAnimationDatafield with no run: the animation has no keys for that attribute on that part. It is the fields’ schema default, so it is never written. - SSAB_
SCHEMA_ VERSION - The
.ssabschema version the converter stamps into every pack it emits and the runtime refuses to read anything else as. - SSQB_
SCHEMA_ VERSION - The
.ssqbcounterpart ofSSAB_SCHEMA_VERSION.
Functions§
- ssab_
schema_ version .ssabschema version. SeeSSAB_SCHEMA_VERSION.- ssqb_
schema_ version .ssqbschema version. SeeSSQB_SCHEMA_VERSION.