#animation #parser #secondlife

avatar-anim

A parser for Second Life avatar animations files

2 releases

Uses new Rust 2024

0.1.1 Sep 14, 2025
0.1.0 Jun 22, 2025

#5 in #secondlife

Download history 1/week @ 2025-08-17 1/week @ 2025-08-24 142/week @ 2025-09-14 8/week @ 2025-09-21 2/week @ 2025-09-28

134 downloads per month

LGPL-2.1

29KB
529 lines

avatar-anim

A Rust library for parsing, inspecting and transforming Second Life avatar animation (.anim) files and Firestorm poser LLSD XML.

Features (brief)

  • Parse & write .anim files (binary) using binrw
  • Import poser LLSD XML (Animation::from_llsd_file)
  • Safe quaternion reconstruction & normalization
  • Key utilities: drop, filter, duplicate cleanup strategies (first/last/average)
  • Quantization helpers with documented error bounds
  • Unified AnimError + Result<T> alias
  • Minimal fluent editing API (priority, stripping rotations/positions)
  • Example CLI (examples/animctl.rs) for info, convert, joints, completions

Quick Start

Add to your project:

cargo add avatar-anim

Example (load, tweak priority, write):

use avatar_anim::Animation;
let mut anim = Animation::from_file("walk.anim")?;
anim.set_priority(4).cleanup_keys_with(avatar_anim::DuplicateKeyStrategy::KeepLast);
anim.to_file("walk_p4.anim")?;
Ok::<_, avatar_anim::Error>(())

CLI (example)

Build and run the example tool:

cargo run --example animctl -- info walk.anim
cargo run --example animctl -- convert -i pose.xml -o pose.anim --insert Head:rot@42
cargo run --example animctl -- joints -j Spine walk.anim

Shell completion script:

cargo run --example animctl -- complete --shell bash > animctl.bash

License

LGPL-2.1

Dependencies

~12MB
~275K SLoC