UnityPack
UnityPack copied to clipboard
AssertionError
Getting an AssertionError when attempting to run unityextract on an .assetbundle
py unityextract No_1.assetbundle
Traceback (most recent call last):
File "unityextract", line 146, in <module>
main()
File "unityextract", line 143, in main
exit(app.run())
File "unityextract", line 53, in run
bundle = unitypack.load(f)
File "C:\Users\XXX\AppData\Local\Programs\Python\Python36-32\lib\site-packages\unitypack-0.6.1-py3.6.egg\unitypack\__init__.py", line 11, in load
return env.load(file)
File "C:\Users\XXX\AppData\Local\Programs\Python\Python36-32\lib\site-packages\unitypack-0.6.1-py3.6.egg\unitypack\environment.py", line 21, in load
ret.load(file)
File "C:\Users\XXX\AppData\Local\Programs\Python\Python36-32\lib\site-packages\unitypack-0.6.1-py3.6.egg\unitypack\assetbundle.py", line 44, in load
assert self.signature in (SIGNATURE_RAW, SIGNATURE_WEB), self.signature
AssertionError
Looking at the docs, it seems this utility only supports .Unity3D bundles. Are .assetbundle files not supported?
Can you upload the file somewhere?
I ran into the same thing was able to resolve it with Asset.from_file
. For example:
import unitypack.asset
with open("example.assets", "rb") as fp:
asset = unitypack.asset.Asset.from_file(fp)
for id, object in asset.objects.items():
print(object.type)
Note: It doesn't know how to handle MonoBehaviour objects, so I had to wrap the ObjectInfo.type
getter call in a try block.