Skip to main content

Module anim

Module anim 

Source
Expand description

Animation file handler with partial support.

This module provides the Anim type for handling animation files (.anim) in Total War PackFiles. Animation files contain skeletal animation data used by the game engine for character and unit animations.

§File Format

Animation files consist of a header followed by binary animation data. The header contains metadata about the animation:

  • Version number
  • Frame rate
  • Skeleton name
  • End time (duration)
  • Bone count

§Limited Support

Support is currently limited because:

  • Header only: Only the header is parsed into structured fields
  • Binary data: Animation data remains as raw bytes
  • No keyframe access: Individual animation keyframes cannot be accessed or modified

This allows basic metadata inspection and preservation of the animation data when re-encoding, but does not enable deep editing of animation curves or keyframes.

§Use Cases

  • Extracting animation metadata (skeleton name, frame rate, duration)
  • Identifying which skeleton an animation is for
  • Re-packing animations without modification
  • Bulk operations on animation files

§Example

use rpfm_lib::files::{Decodeable, anim::Anim};
use std::io::Cursor;

let mut reader = Cursor::new(anim_bytes);
let anim = Anim::decode(&mut reader, &None).unwrap();

// Access metadata
println!("Skeleton: {}", anim.skeleton_name());
println!("Frame rate: {} fps", anim.frame_rate());
println!("Duration: {} seconds", anim.end_time());
println!("Bones: {}", anim.bone_count());

Structs§

Anim
Partially decoded animation file.

Constants§

EXTENSION
Extension for animation files.