#[non_exhaustive]pub enum SpriteError {
Show 27 variants
CropRightLeft,
CropLowerUpper,
RoundNan,
RoundInfinity,
DecompressionBomb {
pixels: String,
},
CIntOverflow {
above: bool,
},
CLongOverflow,
ImageTooWide,
SolveCast,
Rotation(u64),
AlphaSizeMismatch,
AlphaBandCount,
UnverifiedMode {
mode: &'static str,
},
NoVertices,
Unpack {
expected: usize,
got: Option<usize>,
},
Index {
tuple: bool,
},
Sprite3d,
NoTriangles,
NoUv,
NegativeSize,
NoAtlasData,
AtlasUnresolved,
Malformed(&'static str),
Mesh(MeshError),
TooLarge {
what: &'static str,
},
Charge(ChargeError),
Panicked(Payload),
}Expand description
Why a sprite did not render. Each variant but Self::Malformed,
Self::UnverifiedMode, Self::AtlasUnresolved, Self::TooLarge, Self::Charge and
Self::Panicked is a case where UnityPy 1.25.2 raises;
Self::python gives its exception’s class and message.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CropRightLeft
Pillow’s crop of textureRect: its right edge before its left
(ValueError), checked before the lower edge.
CropLowerUpper
Its lower edge above its upper (ValueError).
RoundNan
round() of a NaN (ValueError).
RoundInfinity
round() of an infinity (OverflowError).
DecompressionBomb
Pillow’s crop of more than crate::MAX_CROP_PIXELS pixels
(DecompressionBombError).
CIntOverflow
A box edge that PyArg_ParseTuple’s i refuses within a C long
(OverflowError): past INT_MAX when above, else below
INT_MIN.
CLongOverflow
A box edge past a C long, which PyLong_AsLong refuses before
i sees it (OverflowError).
ImageTooWide
An image Pillow refuses to make: wider than INT_MAX / 4 - 1
pixels, whatever its height (ImagingNewPrologueSubtype’s
MemoryError, which has no message): a crop, its turned size, a
mesh’s canvas, a translated triangle’s crop.
SolveCast
numpy.linalg.solve of a source corner outside [-2^63, 2^64),
which numpy holds in an object array that its solve cannot
cast (UFuncTypeError).
Rotation(u64)
SpritePackingRotation(n) of 5 to 15 (ValueError).
AlphaSizeMismatch
The alpha texture’s decoded size is not the texture’s: Image.merge’s
ValueError.
AlphaBandCount
A texture of one band (BC4’s L) beside an alpha texture:
Image.merge’s ValueError, raised before it compares sizes.
UnverifiedMode
A texture, or an alpha texture, whose decoded mode the renderer is
not verified on (L), where UnityPy renders it: unityrs’s own
refusal (Tier U, PARITY.md section 19.2).
NoVertices
mask_sprite’s assert positions (AssertionError).
Unpack
A tuple unpacked into expected names (ValueError): got fewer,
or None for more.
Index
An index past a list (IndexError “list index out of range”), or
past a tuple when tuple (“tuple index out of range”).
Sprite3d
render_sprite_mesh: every axis of the vertices varies
(ValueError).
NoTriangles
render_sprite_mesh: no submesh with vertices (ValueError).
NoUv
The standalone mesh renderer was given no UV coordinates.
NegativeSize
Image.new of a negative side (ValueError).
NoAtlasData
The atlas holds no render data for the sprite’s key: the
StopIteration of next() (:78).
AtlasUnresolved
The Sprite’s m_SpriteAtlas does not resolve: the caller found no
object for it, where UnityPy’s deref_parse_as_object raises its
own error (Tier U).
Malformed(&'static str)
A field the render reads is missing, or not of the type its typetree gives it, where UnityPy’s behaviour is not characterised (Tier U): named by its path.
Mesh(MeshError)
The mesh’s own error (unityrs_meshdecode).
TooLarge
A canvas of more than crate::MAX_PIXELS pixels: the bound
UnityPy does not have (PARITY.md section 19.3).
Charge(ChargeError)
A buffer’s charge or a loop’s work, refused by the caller’s meter.
Panicked(Payload)
A panic in the render, caught (crate::contain()).
Implementations§
Trait Implementations§
Source§impl Debug for SpriteError
impl Debug for SpriteError
Source§impl Display for SpriteError
impl Display for SpriteError
Source§impl Error for SpriteError
impl Error for SpriteError
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()
Source§impl From<ChargeError> for SpriteError
impl From<ChargeError> for SpriteError
Source§fn from(source: ChargeError) -> Self
fn from(source: ChargeError) -> Self
Source§impl From<DecodeError> for SpriteError
impl From<DecodeError> for SpriteError
Source§fn from(e: DecodeError) -> Self
fn from(e: DecodeError) -> Self
crate::contain()’s errors: a panic, or a charge.