Skip to content

Commit df456b2

Browse files
committed
texture cache fix
1 parent 34a868d commit df456b2

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎UnityPy/enums/TextureFormat.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,10 @@ class TextureFormat(IntEnum):
5757
RG16 = 62,
5858
R8 = 63,
5959
ETC_RGB4Crunched = 64,
60-
ETC2_RGBA8Crunched = 65
60+
ETC2_RGBA8Crunched = 65,
61+
ASTC_HDR_4x4 = 66,
62+
ASTC_HDR_5x5 = 67,
63+
ASTC_HDR_6x6 = 68,
64+
ASTC_HDR_8x8 = 69,
65+
ASTC_HDR_10x10 = 70,
66+
ASTC_HDR_12x12 = 71

‎UnityPy/export/SpriteHelper.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ class SpritePackingRotation(IntEnum):
1717
def get_image(sprite, texture, alpha_texture) -> PIL.Image:
1818
if alpha_texture and getattr(alpha_texture, 'type', '') == "Texture2D":
1919
cache_id = (texture.path_id, alpha_texture.path_id)
20-
if cache_id not in sprite.asset_file._cache:
20+
if cache_id not in sprite.assets_file._cache:
2121
original_image = get_image_from_texture2d(texture.read(), False)
2222
alpha_image = get_image_from_texture2d(alpha_texture.read(), False)
2323
original_image = PIL.Image.merge('RGBA', (*original_image.split()[:3], alpha_image.split()[0]))
24-
sprite.asset_file._cache[cache_id] = original_image
24+
sprite.assets_file._cache[cache_id] = original_image
2525
else:
2626
cache_id = texture.path_id
2727
if cache_id not in sprite.assets_file._cache:

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
setuptools.setup(
77
name="UnityPy",
88
packages=setuptools.find_packages(),
9-
version="1.2.4.4",
9+
version="1.2.4.5",
1010
author="K0lb3",
1111
description="A pythonic port of AssetStudio by Perfare",
1212
long_description=long_description,

0 commit comments

Comments
 (0)