for obj in env.objects:if obj.type.name == "Texture2D":#print(obj.read().name)if obj.read().name == "ShopBGBase02":data = obj.read()data.image = Image.open("backgrounds/temp/temp.png")data.save()breakwith open("../data.unity3d", "wb") as f:f.write(env.file.save())
Error
The error message that is produced by python.
line 49, in <module>f.write(env.file.save())^^^^^^^^^^^^^AttributeError: 'EndianBinaryReader_Streamable_BigEndian' object has no attribute 'save'
Bug
it should save the unitydata file.
To Reproduce
a copy of the file that causes the problem ??
following data:
Python version : 3.12.6
UnityPy version
pip3 install UnityPyDefaulting to user installation because normal site-packages is not writeableRequirement already satisfied: UnityPy in c:\users\areeg\appdata\roaming\python\python312\site-packages (1.10.14)Requirement already satisfied: lz4 in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (4.3.3)Requirement already satisfied: brotli in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (1.1.0)Requirement already satisfied: Pillow in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (10.4.0)Requirement already satisfied: texture2ddecoder in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (1.0.4)Requirement already satisfied: etcpak in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (0.9.9)Requirement already satisfied: tabulate in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (0.9.0)Requirement already satisfied: pyfmodex>=0.7.1 in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (0.7.2)Requirement already satisfied: fsspec in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (2024.9.0)
Code
for obj in env.objects:
if obj.type.name == "Texture2D":
#print(obj.read().name)
if obj.read().name == "ShopBGBase02":
data = obj.read()
data.image = Image.open("backgrounds/temp/temp.png")
data.save()
break
with open("../data.unity3d", "wb") as f:
f.write(env.file.save())
Error The error message that is produced by python.
line 49, in <module>
f.write(env.file.save())
^^^^^^^^^^^^^
AttributeError: 'EndianBinaryReader_Streamable_BigEndian' object has no attribute 'save'
Bug it should save the unitydata file.
To Reproduce
pip3 install UnityPy
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: UnityPy in c:\users\areeg\appdata\roaming\python\python312\site-packages (1.10.14)
Requirement already satisfied: lz4 in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (4.3.3)
Requirement already satisfied: brotli in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (1.1.0)
Requirement already satisfied: Pillow in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (10.4.0)
Requirement already satisfied: texture2ddecoder in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (1.0.4)
Requirement already satisfied: etcpak in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (0.9.9)
Requirement already satisfied: tabulate in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (0.9.0)
Requirement already satisfied: pyfmodex>=0.7.1 in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (0.7.2)
Requirement already satisfied: fsspec in c:\users\areeg\appdata\roaming\python\python312\site-packages (from UnityPy) (2024.9.0)