#[non_exhaustive]pub enum MeshError {
Show 20 variants
Assertion(&'static str),
NoAttribute(&'static str),
UnknownMeshType,
VersionType(u8),
InvalidFormat {
format: u8,
table: FormatTable,
},
UnknownChannel(u64),
NoChannels,
OutOfBounds,
Struct(StructError),
Index(IndexKind),
Unpack {
expected: u8,
got: u8,
},
StopIteration,
Overflow,
ByteRange,
Topology,
Resource(Error),
Charge(ChargeError),
WrappedAccess,
Unsupported(Unsupported),
Malformed(String),
}Expand description
A failure of the mesh handler (module docs).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Assertion(&'static str)
AssertionError: one of process’s or get_triangles’s asserts
(helpers/MeshHelper.py:113, :119-124, :134, :138, :148,
:631-632). The message is the assert’s own, empty for a bare one.
NoAttribute(&'static str)
AttributeError: a field read on an UnknownObject, the class
UnityPyBoost’s object mode builds when the class named by the
node’s type cannot take its fields (PARITY.md section 9.2), that
lacks it ('UnknownObject' object has no attribute 'm_Streams').
UnknownMeshType
ValueError: the source is neither a Mesh nor a
SpriteRenderData, because object mode built it as an
UnknownObject (helpers/MeshHelper.py:171-172).
VersionType(u8)
ValueError: the version’s type byte is no UnityVersionType, which
its first index raises (helpers/UnityVersion.py:41-42, :99-107).
InvalidFormat
ValueError: a channel’s format is not a member of the version’s
format enum (helpers/MeshHelper.py:451-462).
UnknownChannel(u64)
ValueError: a channel past the version’s last
(helpers/MeshHelper.py:395-449).
NoChannels
ValueError: get_streams’s max over no channels
(helpers/MeshHelper.py:257).
OutOfBounds
ValueError: UnityPyBoost’s bounds check
(UnityPyBoost/Mesh.cpp:50-56).
Struct(StructError)
struct.error (its class’s name is error).
Index(IndexKind)
IndexError.
Unpack
ValueError: a strip’s or a quad’s indices unpacked from a slice
the index buffer cuts short (helpers/MeshHelper.py:655, :673),
or a compressed normal’s or tangent’s pair, or a tangent’s pair of
signs, that its vector’s odd count cuts short (:534, :552-553).
StopIteration
StopIteration: a compressed skin whose bone indices end where a
vertex’s fourth is read (next, helpers/MeshHelper.py:605).
Overflow
OverflowError: normalize’s square of a finite component past
the largest float (v**2, helpers/MeshHelper.py:64), the
message CPython’s float_pow gives ERANGE.
ByteRange
ValueError: bytes() of an index list holding a value past a
byte (helpers/MeshHelper.py:175).
Topology
ValueError: a submesh of lines, points or another topology
(helpers/MeshHelper.py:678-679).
Resource(Error)
The core’s error reading m_StreamData’s bytes (Environment::resource,
its port of get_resource_data), as the core reports it.
Charge(ChargeError)
A charge the caller’s meter refused: an array’s memory, or the
work counted before a loop (docs/plans/extract.md E59). UnityPy
has no such bound (PARITY.md section 19.3).
WrappedAccess
UnityPyBoost’s uint32_t arithmetic wrapped and its check passed,
so it would read outside the vertex data or write past the buffer
it allocated, which is undefined behaviour in UnityPy
(UnityPyBoost/Mesh.cpp:47-75); the crate refuses before reading
(PARITY.md section 19.3).
Unsupported(Unsupported)
A part of MeshHandler a later phase ports (module docs of
crate::Unsupported).
Malformed(String)
A field whose value has a type or a range no version’s typetree
gives it, or a node whose type is not the class the field’s
typetree names, which UnityPy’s arithmetic or object mode would take
in ways no test characterises (PARITY.md section 15.3, Tier U).
Implementations§
Trait Implementations§
Source§impl Error for MeshError
impl Error for MeshError
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()