#[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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.source_node_index: usizeStable 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: SourceNodeLocalRestSource-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
impl SourceNodeAsset
Sourcepub fn new(source_node_index: usize, local_rest: SourceNodeLocalRest) -> Self
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
impl Clone for SourceNodeAsset
Source§fn clone(&self) -> SourceNodeAsset
fn clone(&self) -> SourceNodeAsset
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more