Skip to main content

ResolveError

Enum ResolveError 

Source
#[non_exhaustive]
pub enum ResolveError {
Show 15 variants MultipleParents { handle: String, parents: Vec<String>, }, MotionSampledTransform { handle: String, }, Cycle { handle: String, }, Detached { handle: String, }, UnknownHandle { handle: String, }, Instanced { instancer: String, }, MalformedInstanceMatrices { instances: String, values: usize, }, DuplicateModelIndex { instances: String, index: i32, }, UnknownModelIndex { instances: String, model: i32, }, NotAnAncestor { handle: String, ancestor: String, }, MissingSampleAtTime { handle: String, time: f64, available: Vec<f64>, }, MissingFaceCounts { handle: String, }, MalformedIndices { handle: String, attribute: String, indices: usize, face_vertices: usize, values: usize, }, AmbiguousInterpolation { handle: String, attribute: String, values: usize, faces: usize, vertices: usize, face_vertices: usize, }, MalformedFaceCounts { handle: String, expected: usize, found: usize, },
}
Expand description

Why a scene could not be resolved into flat facts.

Every variant is a scene ɴsɪ permits but this crate refuses to guess about. Returning a matrix or a binding anyway would be the silent failure the crate exists to prevent: it renders, with the wrong answer.

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

MultipleParents

A node is connected to more than one parent.

Usually through objects; a prototype connected to two instances nodes is the same problem.

That is ɴsɪ’s lightweight instancing: the node appears once per path, each with its own world transform. A single matrix cannot describe it, so resolving one is refused rather than silently answering for whichever parent was connected first.

Fields

§handle: String

The node with more than one parent.

§parents: Vec<String>

Every parent, in connection order.

§

MotionSampledTransform

A node carries motion-sampled placement data where a single answer was asked for.

Either a transformationmatrix on a node in the chain, or an instances node’s transformationmatrices, modelindices or disabledinstances. Answering with the static value would hand a motion-blurred scene back its unblurred pose, and answering with an empty list – which the instancer path used to do – reads as “nothing to draw”.

Ask at a time instead: Scene::world_transform_interpolated_at, Scene::placements_at or Scene::instance_transforms_at.

Fields

§handle: String

The node whose transform is motion-sampled.

§

Cycle

The transform chain revisits a node. ɴsɪ does not forbid a cycle; no correct answer exists for one.

Fields

§handle: String

The node the walk arrived at twice.

§

Detached

The node is not connected to .root, directly or through transforms.

ɴsɪ: “A node can exist in an nsi context without being connected to the root node but in that case it won’t affect the render in any way.” It has no world transform and no gathered attributes, and answering identity would put unrendered geometry at the origin.

Fields

§handle: String

The node that does not reach .root.

§

UnknownHandle

No node with that handle exists.

Asking about an attribute of a node that was never created is a caller mistake, and answering “not sampled” would read as a fact about the scene rather than about the question.

Fields

§handle: String

The handle that names nothing.

§

Instanced

The node is an instancing prototype, so it has no single world transform.

A prototype reaches the scene through an instances node, and ɴsɪ gives that node “a transformation matrix for each instance”. Answering with the instancer’s own transform would put every instance in the same, wrong place.

Fields

§instancer: String

The instances node the prototype is connected to.

§

MalformedInstanceMatrices

An instances node’s transformationmatrices is not a whole number of 4x4 matrices.

Fields

§instances: String

The instances node.

§values: usize

How many values it carries.

§

DuplicateModelIndex

Two prototype connections share one index.

ɴsɪ: connections “must have an integer index attribute if there are several, so the models effectively form an ordered list” – which a duplicate does not.

Fields

§instances: String

The instances node.

§index: i32

The index used twice.

§

UnknownModelIndex

A modelindices entry matches no prototype connection’s index.

Fields

§instances: String

The instances node.

§model: i32

The index that matches nothing.

§

NotAnAncestor

Scene::relative_transform was given a node that is not on the chain.

Fields

§handle: String

The node whose chain was walked.

§ancestor: String

The node that is not on it.

§

MissingSampleAtTime

A node in the chain is motion-sampled, but has no sample at the requested time.

From the exact-hit accessors only – Scene::world_transform_at, Scene::world_transform_samples and Scene::instance_transforms answer where a sample exists and refuse elsewhere, which is the right answer to “what did the caller record”.

For “where is it mid-shutter”, ask Scene::world_transform_interpolated_at, Scene::placements_at or Scene::instance_transforms_at. Those interpolate element-wise, which is the renderer’s own model rather than a guess – 3Delight’s rotation blur fits component-wise far better than slerp – and they hold the end sample outside the sampled range, as it does.

The interpolating accessors still return this for a time that names no sample at all, such as a NaN. An earlier version of this said the crate never interpolates and that the decomposition was the backend’s; that stopped being true when those accessors were added.

Fields

§handle: String

The node with no sample at that time.

§time: f64

The time that was asked for.

§available: Vec<f64>

The times that node does have, ascending.

§

MissingFaceCounts

A mesh has no nvertices, which ɴsɪ requires.

Fields

§handle: String

The mesh.

§

MalformedIndices

A <name>.indices is not one entry per face-vertex, or points outside the values it indexes.

ɴsɪ says the indices say “which values of the other parameter to use” and nothing about how many values there are, so the indices are what must match the primitive.

Fields

§handle: String

The primitive.

§attribute: String

The attribute the indices belong to.

§indices: usize

How many indices there are.

§face_vertices: usize

How many the primitive’s face-vertices need.

§values: usize

How many values there are to index.

§

AmbiguousInterpolation

A primitive variable’s value count matches none of the four interpolations.

Constant is one value, uniform is one per face, vertex is one per vertex and face-varying is one per face-vertex. A count that is none of those has no meaning ɴsɪ defines, and guessing one renders – plausibly, and wrongly, which is how a wrong normal survives review.

Fields

§handle: String

The primitive.

§attribute: String

The attribute.

§values: usize

How many values it carries.

§faces: usize

How many faces the primitive has.

§vertices: usize

How many vertices.

§face_vertices: usize

How many face-vertices.

§

MalformedFaceCounts

nholes and nvertices disagree.

ɴsɪ: with nholes set, the face count is the number of nholes values, and each face takes nholes + 1 values from nvertices – the outer perimeter and then one per hole. A count that does not add up leaves the faces undefined, and a backend that reads nvertices as one-count-per-face draws a different mesh without reporting anything.

Fields

§handle: String

The mesh.

§expected: usize

How many nvertices values the holes ask for.

§found: usize

How many there are.

Trait Implementations§

Source§

impl Clone for ResolveError

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

impl Debug for ResolveError

Source§

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

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

impl Display for ResolveError

Source§

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

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

impl Error for ResolveError

1.30.0 · 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 PartialEq for ResolveError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ResolveError

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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> 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, !>

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.