Comments (1)
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.
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()
```
Since you don't change any asset, I'm wondering why you even try to repack/save the "asset".
Anyway, since you're loading no Unity asset, the save command can't be applied to the only loaded file either.
from unitypy.
Related Issues (20)
- Run code using Android HOT 1
- ContainerHelper does not look right that .container returns None
- can't read typetree from assets HOT 2
- Unable to extract Unity 2022.03.7f1 Texture2D correctly HOT 1
- Reading typetree error: Can't read 4 bytes at position 32 of 32 HOT 1
- Unable to load APK files directly HOT 1
- Flip operation for packed sprite are reversed
- Load dependencies with sensitive paths HOT 2
- Crashes when reading RGB24 Texture2D HOT 2
- Segmentation fault when unpacking DXT5Crunched texture HOT 5
- wishlist: support "bundle"/"bank"? HOT 1
- AudioClip can not be exported. What does the FmodError : MEMORY mean?? HOT 2
- Is Windows SDK required for installing UnityPy? HOT 3
- Please add support for Texture2DArray
- Texture2D 2022.2 bug HOT 6
- error when exporting mesh_renderer
- Saving files bigger than 4GB HOT 2
- Edit Texture2D make file corrupted HOT 9
- .save_typetree() MonoBehaviour function not working.
- `env.objects == []` & `env.container.items() == dict_items([])` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unitypy.