Skip to main content

SourceNodeAsset

Struct SourceNodeAsset 

Source
#[non_exhaustive]
pub struct SourceNodeAsset { pub source_node_index: usize, pub name: Option<String>, pub parent_source_node_index: Option<usize>, pub scene_root_indices: Vec<usize>, pub local_rest: SourceNodeLocalRest, pub bone: Option<BoneId>, }
Expand description

One source-side node with stable loader identity facts.

For a direct format projection this is an authored node. A loader that normalizes helper or inheritance semantics may also include generated source-side nodes, provided its capability inventory records that boundary.

Marked #[non_exhaustive] because this projection grows as loaders learn to carry more source-native identity (bone was the most recent addition): out-of-crate embedders construct it through SourceNodeAsset::new and assign the optional facts they have, so a later field cannot break their build. The sibling source-asset structs in this module are not yet marked; they are stable in a way this one has already demonstrated it is not.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§source_node_index: usize

Stable index in the loader’s complete source-side node table.

§name: Option<String>

Source-projected node name, when present.

§parent_source_node_index: Option<usize>

Source-side node-table index of the projected parent, when any.

§scene_root_indices: Vec<usize>

Source scenes that name this projected node as a root, in source-scene order.

§local_rest: SourceNodeLocalRest

Source-projected local-rest representation.

§bone: Option<BoneId>

The core BoneId this source node normalized to, when the loader retained it as an independent normalized node.

None means this source row has no independent Skeleton bone. A loader may have dropped an unreachable node, or it may have folded a static connector’s authored local rest into the next projected node. The row remains authoritative source identity and local-rest evidence under SourceSkeletonCoverage::Complete. Format-neutral consumers that need to resolve a raw source-node selector (for example crate::scale::ScaleOperation::RestBindUniformScale’s source_root_node_index/skin joints) into the normalized Skeleton must use this field rather than assuming source-node order equals bone order.

With SourceSkeletonCoverage::Complete coverage, the Some rows must form a downward-closed, nearest-projected-parent-preserving projection into the normalized skeleton. Unprojected source rows may occur between projected ancestors; validate_document_shape verifies that relation.

Implementations§

Source§

impl SourceNodeAsset

Source

pub fn new(source_node_index: usize, local_rest: SourceNodeLocalRest) -> Self

One source node identified by its stable source-array index and its source-projected local rest — the two facts every loader necessarily has.

Every remaining fact (Self::name, Self::parent_source_node_index, Self::scene_root_indices, Self::bone) starts absent and is assigned through the public fields. This is the only way to build the value outside animsmith-core, since the type is #[non_exhaustive].

Trait Implementations§

Source§

impl Clone for SourceNodeAsset

Source§

fn clone(&self) -> SourceNodeAsset

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
Source§

impl Debug for SourceNodeAsset

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.