pub struct Anim { /* private fields */ }Expand description
Partially decoded animation file.
Contains parsed header metadata and raw binary animation data. The header provides information about the animation’s properties, while the actual keyframe data remains in binary form.
§Fields
version- Animation file format versionuk_1- Unknown field (purpose not yet identified)frame_rate- Animation playback speed in frames per secondskeleton_name- Name of the skeleton this animation is forend_time- Animation duration in secondsbone_count- Number of bones animated in this filedata- Raw binary animation data (keyframes, curves, etc.)
§Getters/Setters
All fields have public getters, mutable getters, and setters via the getset crate:
version(),version_mut(),set_version()uk_1(),uk_1_mut(),set_uk_1()frame_rate(),frame_rate_mut(),set_frame_rate()skeleton_name(),skeleton_name_mut(),set_skeleton_name()end_time(),end_time_mut(),set_end_time()bone_count(),bone_count_mut(),set_bone_count()data(),data_mut(),set_data()
§Example
use rpfm_lib::files::{Decodeable, anim::Anim};
use std::io::Cursor;
let mut reader = Cursor::new(anim_data);
let anim = Anim::decode(&mut reader, &None).unwrap();
// Check if animation matches expected skeleton
if anim.skeleton_name().contains("humanoid") {
println!("Found humanoid animation: {} seconds at {} fps",
anim.end_time(), anim.frame_rate());
}Implementations§
Source§impl Anim
impl Anim
Sourcepub fn frame_rate(&self) -> &f32
pub fn frame_rate(&self) -> &f32
Animation playback speed in frames per second.
Sourcepub fn skeleton_name(&self) -> &String
pub fn skeleton_name(&self) -> &String
Name of the skeleton this animation targets.
Sourcepub fn bone_count(&self) -> &u32
pub fn bone_count(&self) -> &u32
Number of bones animated in this file.
Source§impl Anim
impl Anim
Sourcepub fn version_mut(&mut self) -> &mut u32
pub fn version_mut(&mut self) -> &mut u32
Animation file format version.
Sourcepub fn frame_rate_mut(&mut self) -> &mut f32
pub fn frame_rate_mut(&mut self) -> &mut f32
Animation playback speed in frames per second.
Sourcepub fn skeleton_name_mut(&mut self) -> &mut String
pub fn skeleton_name_mut(&mut self) -> &mut String
Name of the skeleton this animation targets.
Sourcepub fn end_time_mut(&mut self) -> &mut f32
pub fn end_time_mut(&mut self) -> &mut f32
Animation duration in seconds.
Sourcepub fn bone_count_mut(&mut self) -> &mut u32
pub fn bone_count_mut(&mut self) -> &mut u32
Number of bones animated in this file.
Source§impl Anim
impl Anim
Sourcepub fn set_version(&mut self, val: u32) -> &mut Self
pub fn set_version(&mut self, val: u32) -> &mut Self
Animation file format version.
Sourcepub fn set_frame_rate(&mut self, val: f32) -> &mut Self
pub fn set_frame_rate(&mut self, val: f32) -> &mut Self
Animation playback speed in frames per second.
Sourcepub fn set_skeleton_name(&mut self, val: String) -> &mut Self
pub fn set_skeleton_name(&mut self, val: String) -> &mut Self
Name of the skeleton this animation targets.
Sourcepub fn set_end_time(&mut self, val: f32) -> &mut Self
pub fn set_end_time(&mut self, val: f32) -> &mut Self
Animation duration in seconds.
Sourcepub fn set_bone_count(&mut self, val: u32) -> &mut Self
pub fn set_bone_count(&mut self, val: u32) -> &mut Self
Number of bones animated in this file.
Trait Implementations§
Source§impl Decodeable for Anim
impl Decodeable for Anim
Source§impl<'de> Deserialize<'de> for Anim
impl<'de> Deserialize<'de> for Anim
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Encodeable for Anim
impl Encodeable for Anim
Source§fn encode<W: WriteBytes>(
&mut self,
buffer: &mut W,
_extra_data: &Option<EncodeableExtraData<'_>>,
) -> Result<()>
fn encode<W: WriteBytes>( &mut self, buffer: &mut W, _extra_data: &Option<EncodeableExtraData<'_>>, ) -> Result<()>
impl StructuralPartialEq for Anim
Auto Trait Implementations§
impl Freeze for Anim
impl RefUnwindSafe for Anim
impl Send for Anim
impl Sync for Anim
impl Unpin for Anim
impl UnsafeUnpin for Anim
impl UnwindSafe for Anim
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.