Skip to main content

Crate animsmith_fbx

Crate animsmith_fbx 

Source
Expand description

load and load_bytes read FBX input into an animsmith_core::Document, normalizing parser errors into LoadError. The resulting document carries skeletons, animation clips, and scene assets in the same core model used by the glTF loader.

The loader normalizes FBX scenes into animsmith’s runtime-oriented coordinate space before handing them to animsmith-core: right-handed +Y-up axes, metres, transform-adjust conversion, helper nodes for geometric transforms, and compensated scale inheritance. Depend on this crate only when your pipeline accepts FBX input; it brings the bundled ufbx C build that animsmith-core and animsmith-gltf intentionally avoid.

load_scale_source and load_scale_source_bytes retain a typed FbxScaleCapabilityInventory from the same parse. It gives every current Appendix D.4 domain an explicit status and records baked curves, normalized transforms, derived binds, truncated/renormalized influences, triangulation, welding, generated data, and unavailable raw-span proof. capability_facts projects that explicit inventory into core facts, but the result remains unsupported: both scale operations are intentionally refused until a later FBX writer and proof boundary exists.

§Quick start

fn lint_fbx(
    path: &std::path::Path,
) -> Result<Vec<animsmith_core::Finding>, Box<dyn std::error::Error>> {
    let doc = animsmith_fbx::load(path)?;
    let roles = animsmith_core::detect_profile(&doc.skeleton).unwrap_or_default();
    let config = animsmith_core::Config::default();
    let grids = animsmith_core::MetricGrids::new(&doc);
    let ctx = animsmith_core::CheckCtx::new(&grids, &roles, &config);
    let results = animsmith_core::evaluate_checks(
        &ctx,
        &animsmith_core::all_checks(),
        animsmith_core::CheckSelection::All,
    )?;
    Ok(results
        .into_iter()
        .flat_map(|check| check.findings().to_vec())
        .collect())
}

§Build and API status

The library crate has no public feature flags and supports the workspace MSRV, Rust 1.88. It includes the bundled ufbx C build. Its Rust API is pre-1.0; see animsmith-core’s crate-level API status for the shared stability boundary.

See the GitHub embedding guide for crate selection and the pipeline scenario guide for FBX intake and conversion workflows.

Structs§

FbxCoordinateNormalization
Coordinate and unit normalization applied by the loader.
FbxScaleCapabilityInventory
Deterministic capability inventory captured from one successfully parsed FBX scene.
FbxScaleDomainInventory
Explicit status for every current domain row in DESIGN.md Appendix D.4.
FbxScaleSource
One FBX document and the capability inventory captured from the same parse.
FbxSourceIdentity
Stable source identity retained beside one normalized ufbx element.

Enums§

FbxBindMatrixProvenance
Provenance of inverse-bind matrices projected into the source sidecar.
FbxCoordinateAxis
A format-independent spelling of one FBX coordinate axis.
FbxScaleDomainStatus
How one Appendix D.4 domain reaches the normalized FBX document.
LoadError
Errors returned while loading an FBX scene into the core model.

Functions§

capability_facts
Project an FBX inventory into the format-neutral core capability gate.
load
Load an .fbx file into a core Document: skeleton, animation, and scene assets (triangulated meshes, skins, factor-only materials). Consumers that only judge animation ignore Document::assets.
load_bytes
Load an FBX byte slice into a core Document.
load_scale_source
Load an .fbx file and retain its conservative scale capability inventory.
load_scale_source_bytes
Load captured FBX bytes and retain the capability inventory from the same parse.