From 80745cfd1c7b0b8b477414418fb1137204b80983 Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Tue, 5 Jul 2022 03:08:52 +0000 Subject: [PATCH] Add TextureEntry.unwrap() to ease working with potentially lazy TEs --- hippolyzer/lib/base/templates.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hippolyzer/lib/base/templates.py b/hippolyzer/lib/base/templates.py index bf1aa39..e455cdc 100644 --- a/hippolyzer/lib/base/templates.py +++ b/hippolyzer/lib/base/templates.py @@ -1067,6 +1067,10 @@ class TextureEntry: Glow: Dict[_TE_FIELD_KEY, int] = _te_field(se.U8, default=0) Materials: Dict[_TE_FIELD_KEY, UUID] = _te_field(se.UUID, optional=True, default=UUID()) + def unwrap(self): + """Return `self` regardless of whether this is lazy wrapped object or not""" + return self + TE_SERIALIZER = se.Dataclass(TextureEntry)