#[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
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
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.
Cycle
The transform chain revisits a node. ɴsɪ does not forbid a cycle; no correct answer exists for one.
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.
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.
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.
MalformedInstanceMatrices
An instances node’s transformationmatrices is not a whole
number of 4x4 matrices.
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.
UnknownModelIndex
A modelindices entry matches no prototype connection’s
index.
NotAnAncestor
Scene::relative_transform was given a node that is not on the
chain.
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
MissingFaceCounts
A mesh has no nvertices, which ɴsɪ requires.
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
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
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.
Trait Implementations§
Source§impl Clone for ResolveError
impl Clone for ResolveError
Source§impl Debug for ResolveError
impl Debug for ResolveError
Source§impl Display for ResolveError
impl Display for ResolveError
Source§impl Error for ResolveError
impl Error for ResolveError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()