Skip to main content

CachedPartData

Struct CachedPartData 

Source
pub struct CachedPartData {
Show 16 fields pub part_index: i16, pub parent_index: i16, pub coverage: UpdateAttributeFlags, pub name_hash: u32, pub key_mask: u64, pub cursor_base: u32, pub constant_mask: u64, pub shape_kind: Option<ShapeType>, pub nines: Option<NinesPartData>, pub mesh_binding: Option<Arc<MeshBindingCache>>, pub mesh_cell: Option<Arc<MeshCellData>>, pub blend_type: BlendType, pub part_type_disc: PartType, pub mask_influence: bool, pub is_mask_contributor: bool, pub runs: Box<[KeyRun]>,
}

Fields§

§part_index: i16§parent_index: i16§coverage: UpdateAttributeFlags

Which continuous attributes (MIXED_ATTRIBUTES) this animation actually keys on this part. Decided per animation (the run exists at all), never per frame — a per-frame signal would flip at the first key and make the part pop in and out of the mix mid-playback.

The mix consults this to keep a source that does not animate an attribute from voting evaluate_part’s hardcoded default into the weighted sum. Note the converter seeds every animation with the setup pose, so “has a run” means “authored by the animator or by the setup pose” — both are real poses, and only the genuinely absent case is excluded.

§name_hash: u32

fnv1a_hash_str(PartData.name), cached for the Override Layer’s name -> part_index resolver. Stable within an SSAB (part identity is AnimationPack-scoped and 1:1 with parts_animation_data).

§key_mask: u64

One bit per attribute this part has keys for, at the attribute’s IDX_ATTRIBUTE* position. An instance keeps a key cursor for each of these attributes only, in bit order (see cursor_slot).

§cursor_base: u32

Where this part’s key cursors start in an instance’s cursor buffer: the number of cursors every earlier part of the animation keeps.

§constant_mask: u64

The keyed attributes that read the same on every frame of the animation — a run of one key, which the animation reaches at its start — as key_mask bits. They are evaluated once, into the animation’s part bases, rather than on every frame.

§shape_kind: Option<ShapeType>§nines: Option<NinesPartData>§mesh_binding: Option<Arc<MeshBindingCache>>§mesh_cell: Option<Arc<MeshCellData>>§blend_type: BlendType§part_type_disc: PartType§mask_influence: bool§is_mask_contributor: bool§runs: Box<[KeyRun]>

The key runs of the attributes in key_mask, in bit order: attribute idx is runs[cursor_slot(key_mask, idx)], the same packing as an instance’s cursors. A part keys a handful of its attributes, so this holds a few runs. Read one with run.

Implementations§

Source§

impl CachedPartData

Source

pub fn new( part: PartAnimationData<'_>, keys: &KeyColumns<'_>, part_index: i16, parent_index: i16, name_hash: u32, shape_kind: Option<ShapeType>, nines: Option<NinesPartData>, mesh_binding: Option<Arc<MeshBindingCache>>, mesh_cell: Option<Arc<MeshCellData>>, blend_type: BlendType, part_type_disc: PartType, mask_influence: bool, is_mask_contributor: bool, start_frame: i32, ) -> Self

Source

pub fn run(&self, idx: usize) -> Option<KeyRun>

This part’s key run for attribute idx (an IDX_ATTRIBUTE*), or None when the part has no keys for it.

Source

pub fn cursors<'c>(&self, all: &'c mut [u32]) -> &'c mut [u32]

This part’s key cursors within an instance’s cursor buffer.

Trait Implementations§

Source§

impl Clone for CachedPartData

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more