You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
src = "D:\\ZTA\\MLBG Data\\#MLBGChanger-Python\\restore\\"+b
src = b"bytes"
src = io.BytesIO(b"Streamable")
env = UnityPy.load(src)
for obj in env.objects:
if obj.type in ["Texture2D"]:
# export texture
data = obj.read()
if data.name == a:
# edit texture
with Image.open(a+".png") as pil_img:
data.image = pil_img
data.save()
with open(b, "wb") as f:
f.write(env.file.save())
Error
Traceback (most recent call last):
File "D:\ZTA\MLBG Data\#MLBGChanger-Python\ImageConverter.py", line 78, in <module>
f.write(env.file.save())
AttributeError: 'EndianBinaryReader_Streamable' object has no attribute 'save'
Bug
I can't save it.
The text was updated successfully, but these errors were encountered:
This code can't work and doesn't do what you're intended to do.
You pass
src = io.BytesIO(b"Streamable")
to UnityPy.
The object isn't an Unity asset, so UnityPy will just store it as reader.
Since UnityPy got no Unity asset as input, it won't be able to find any objects,
so your loop below won't do anything, in fact, it will just be skipt as env.objects will be empty.
forobjinenv.objects:
ifobj.typein ["Texture2D"]:
# export texturedata=obj.read()
ifdata.name==a:
# edit texturewithImage.open(a+".png") aspil_img:
data.image=pil_imgdata.save()
```
Sinceyoudon't change any asset, I'mwonderingwhyyoueventrytorepack/savethe"asset".
Anyway, sinceyou're loading no Unity asset, the save command can'tbeappliedtotheonlyloadedfileeither.
Code
Error
Bug
I can't save it.
The text was updated successfully, but these errors were encountered: