Skip to main content

GltfScaleRewriteError

Enum GltfScaleRewriteError 

Source
#[non_exhaustive]
pub enum GltfScaleRewriteError {
Show 18 variants Capability { violations: Vec<GltfCapabilityViolation>, count: usize, }, Plan(ScaleError), Load(LoadError), Write(WriteError), UnhandledLengthField { location: String, }, ConflictingRewriteRule { accessor_index: usize, }, UnrewritableAccessor { accessor_index: usize, location: String, }, ConflictingNodeTransform { location: String, }, NonAffineNodeMatrix { location: String, value: f64, expected: f64, }, ImagePayloadOverlap { location: String, accessor_index: usize, }, UnreassemblableContainer { reason: &'static str, }, ValueNotRepresentable { location: String, value: f64, }, ConflictingRestBindFactor { accessor_index: usize, element: usize, first_location: String, first_factor: f64, second_location: String, second_factor: f64, }, ClosureMismatch { planned: Vec<usize>, derived: Vec<usize>, }, ParentChainDisagreement { source_node_index: usize, }, AmbiguousSourceNodeProjection { bone: BoneId, }, UnusableSourceHierarchy { reason: &'static str, }, ArtifactProofFailed { claim: &'static str, observed: f64, tolerance: f64, raw_json_differences: Option<GltfRawJsonDifferenceSummary>, },
}
Expand description

Typed, fail-closed rejection from rewrite_linear_units or prove_rewritten_artifact.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Capability

The source’s raw capability manifest declares a domain the rewrite cannot preserve or convert.

Fields

§violations: Vec<GltfCapabilityViolation>

Deterministically ordered typed violations.

§count: usize

Number of violations, repeated for stable error rendering.

§

Plan(ScaleError)

Shared core planning or proof rejected the request.

§

Load(LoadError)

The source or the rewritten artifact could not be read.

§

Write(WriteError)

The rewritten container could not be emitted.

§

UnhandledLengthField

A length-bearing member has no registered field handler, so its value would be left in the source unit while everything around it moved.

Fields

§location: String

JSON pointer of the unconvertible member.

§

ConflictingRewriteRule

Two logical uses of one accessor disagree on how it converts.

Fields

§accessor_index: usize

The contested accessor index.

§

UnrewritableAccessor

An accessor selected for rewriting is not the dense f32 layout the preflight vouched for.

Fields

§accessor_index: usize

The accessor index.

§location: String

JSON pointer of the accessor.

§

ConflictingNodeTransform

A node declares matrix alongside a TRS member. glTF 2.0 forbids the combination, and the gltf crate accepts it, so the conversion would otherwise emit two rewrites for one node’s single transform.

Fields

§location: String

JSON pointer of the TRS member that conflicts with matrix.

§

NonAffineNodeMatrix

A node matrix is not TRS-decomposable: its last row is not (0, 0, 0, 1), so it carries a projective component that transforms as 1/q rather than staying dimensionless under U M U^-1.

Fields

§location: String

JSON pointer of the offending matrix entry.

§value: f64

The authored value.

§expected: f64

The only value glTF 2.0 permits there.

§

ImagePayloadOverlap

An image reads a buffer view overlapping an accessor the conversion rewrites, so converting would corrupt the image payload.

#280’s inspect_accessor_layouts ranges accessors only, so an image buffer view is invisible to its disjointness proof.

Fields

§location: String

JSON pointer of the offending image.

§accessor_index: usize

The accessor whose rewritten range it overlaps.

§

UnreassemblableContainer

The source container cannot be reassembled without inventing a buffer-to-chunk mapping.

Fields

§reason: &'static str

Stable machine-readable reason.

§

ValueNotRepresentable

One converted element has no usable f32 image: the product is not finite, or a nonzero product flushed to zero.

Fields

§location: String

Located JSON pointer or accessor element identity.

§value: f64

The f64 product that could not be narrowed.

§

ConflictingRestBindFactor

Two logical uses of one accessor demand different rest/bind factors, so no single rewrite of that accessor can satisfy both.

This is a fail-closed domain #280 does not produce. Its aliasing guard is a two-value classification — scale-bearing versus dimensionless — and fires only on the cross; the scale-bearing/scale-bearing cross is accepted, correctly, because a whole-document conversion multiplies every such use by the same q. Under a rest/bind reparameterization the multiplier differs per node and per skin slot, so the same sharing makes “rebase affected translation animation values” and “preserve declared unaffected payloads” simultaneously unsatisfiable. The manifest is clean and the file is valid glTF; it is the plan that makes the sharing unsatisfiable.

Splitting the accessor is not the remedy: it would change the accessors and bufferViews array lengths and destroy the array identities the artifact proof pins. Both claimants are named so the source can be fixed instead.

Fields

§accessor_index: usize

The contested accessor index.

§element: usize

First element index at which the two claims disagree.

§first_location: String

JSON pointer of the first use to claim this accessor.

§first_factor: f64

The factor that use demands at element.

§second_location: String

JSON pointer of the use that disagreed.

§second_factor: f64

The factor that use demands at element.

§

ClosureMismatch

The affected closure derived from the raw node hierarchy is not the closure animsmith_core::scale::plan_scale planned.

The plan walks SourceNodeAsset::parent_source_node_index; this crate walks /nodes/*/children. animsmith_core requires the projection to agree with the normalized skeleton, but it never sees the raw child arrays, so a projection that contradicts the JSON it was derived from plans, builds and proves cleanly there.

Fields

§planned: Vec<usize>

Plan closure, as source-node indices in ascending order.

§derived: Vec<usize>

Raw-hierarchy closure, as source-node indices in ascending order.

§

ParentChainDisagreement

A node’s parent in the normalized skeleton is not its parent in the raw node hierarchy, so the two disagree about which nodes inherit the factor being removed.

Fields

§source_node_index: usize

The source node whose two parent links disagree.

§

AmbiguousSourceNodeProjection

Two source nodes claim the same normalized animsmith_core::BoneId, so the plan’s bone-keyed closure cannot be resolved back to a unique source node to rewrite.

Fields

§bone: BoneId

The contested bone.

§

UnusableSourceHierarchy

The raw node hierarchy cannot support the requested closure.

Fields

§reason: &'static str

Stable machine-readable reason.

§

ArtifactProofFailed

An artifact-level proof claim failed.

Fields

§claim: &'static str

Stable machine-readable claim identity.

§observed: f64

Observed residual, count, or difference.

§tolerance: f64

The bound it exceeded.

§raw_json_differences: Option<GltfRawJsonDifferenceSummary>

Bounded, value-free locations for a raw JSON preservation failure.

Every other artifact proof claim carries None because its existing typed fields already identify the failed obligation.

Trait Implementations§

Source§

impl Debug for GltfScaleRewriteError

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for GltfScaleRewriteError

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Error for GltfScaleRewriteError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<LoadError> for GltfScaleRewriteError

Source§

fn from(source: LoadError) -> Self

Converts to this type from the input type.
Source§

impl From<ScaleError> for GltfScaleRewriteError

Source§

fn from(source: ScaleError) -> Self

Converts to this type from the input type.
Source§

impl From<WriteError> for GltfScaleRewriteError

Source§

fn from(source: WriteError) -> Self

Converts to this type from the input type.

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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, <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.