#[non_exhaustive]pub enum GltfError {
Show 17 variants
NotUtf8,
UnsupportedVersion(String),
BadHeader,
LegacyBinary,
TruncatedChunk,
NoJsonChunk,
NoBinChunk,
MissingField {
what: &'static str,
},
MissingIndex {
kind: &'static str,
index: usize,
},
UnsupportedComponentType(i64),
UnsupportedAccessorType(String),
BadDataUri(String),
BadBase64(char),
UnsupportedRequiredExtension(String),
Draco {
mesh: usize,
primitive: usize,
reason: String,
},
BufferViewOutOfRange {
index: usize,
},
Meshopt {
buffer_view: usize,
reason: String,
},
}Expand description
What went wrong inside a glTF asset, as far as the loader reads it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotUtf8
A JSON chunk, or a .gltf file, that is not UTF-8.
UnsupportedVersion(String)
asset.version is not 2.x.
BadHeader
The 12-byte GLB header has the wrong magic.
LegacyBinary
A GLB written against the draft container format.
TruncatedChunk
A GLB chunk that runs past the end of the file.
NoJsonChunk
A GLB with no JSON chunk.
NoBinChunk
A buffer with no uri in a GLB that has no BIN chunk.
MissingField
A field a definition cannot be read without (accessor.type,
sampler.input, …). what names it.
MissingIndex
An index into one of the asset’s arrays that is not there. kind is the
array (accessor, bufferView, buffer, mesh).
UnsupportedComponentType(i64)
An accessor componentType the port does not read.
UnsupportedAccessorType(String)
An accessor type the port does not read.
BadDataUri(String)
A data: URI that is not data:<mime>;base64,<payload>.
BadBase64(char)
A character that is not in the base64 alphabet.
UnsupportedRequiredExtension(String)
An extension in extensionsRequired that the port does not read.
three.js only warns here ('Unknown extension') and then decodes
nothing, which on this stack is a silent wrong picture, so the port
refuses the asset instead.
Draco
A KHR_draco_mesh_compression primitive that does not decode. mesh
and primitive locate it; reason is the decoder’s, or what
DRACOLoader would have thrown on.
Fields
BufferViewOutOfRange
A bufferView whose byte range runs past the end of its buffer.
Meshopt
An EXT_meshopt_compression bufferView that does not decode.
reason is the decoder’s, or the extension rule it breaks.
Trait Implementations§
Source§impl Error for GltfError
impl Error for GltfError
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()