Open andburn opened 8 years ago
Resolve the path via s/^library/Resources/
This needs changed https://github.com/HearthSim/UnityPack/blob/master/unitypack/asset.py#L60
and while we're here, need a better way (i.e. type detection) of loading files than explicitly saying asset/assetbundle -- lots of files that are assets don't end in ".assets".
UnityPack can't load unity default resources
as an asset at all right now - tried last night, failed. @andburn I'd love your help to fix it!
Yeah there seems to be a problem loading files as assets, like resources.assets
. I'll have a look into it.
@andburn I have error library/unity default resources. Have you found any fix? I tried everything out.
Traceback (most recent call last):
File "D:\Downloads\UnityPack-master\UnityPack-master\bin\unityextract", line 146, in <module>
main()
File "D:\Downloads\UnityPack-master\UnityPack-master\bin\unityextract", line 143, in main
exit(app.run())
File "D:\Downloads\UnityPack-master\UnityPack-master\bin\unityextract", line 56, in run
self.handle_asset(asset)
File "D:\Downloads\UnityPack-master\UnityPack-master\bin\unityextract", line 82, in handle_asset
if obj.type not in self.handle_formats:
File "C:\Users\Alexander\AppData\Local\Programs\Python\Python35\lib\site-packages\unitypack\object.py", line 31, in type
typename = script.resolve()["m_ClassName"]
File "C:\Users\Alexander\AppData\Local\Programs\Python\Python35\lib\site-packages\unitypack\object.py", line 179, in resolve
return self.object.read()
File "C:\Users\Alexander\AppData\Local\Programs\Python\Python35\lib\site-packages\unitypack\object.py", line 172, in object
return self.asset.objects[self.path_id]
File "C:\Users\Alexander\AppData\Local\Programs\Python\Python35\lib\site-packages\unitypack\object.py", line 167, in asset
ret = ret.resolve()
File "C:\Users\Alexander\AppData\Local\Programs\Python\Python35\lib\site-packages\unitypack\asset.py", line 188, in resolve
return self.source.get_asset(self.file_path)
File "C:\Users\Alexander\AppData\Local\Programs\Python\Python35\lib\site-packages\unitypack\asset.py", line 62, in get_asset
return self.environment.get_asset_by_filename(path)
File "C:\Users\Alexander\AppData\Local\Programs\Python\Python35\lib\site-packages\unitypack\environment.py", line 46, in get_asset_by_filename
raise KeyError("No such asset: %r" % (name))
KeyError: "No such asset: 'library/unity default resources'"
@verng Unfortunately not 😞
We've added e1a840bff7e80d6d21d2f7cc033876eabf97fa82 to skip these for now with a warning, so at least bundles containing these files can be loaded. Obviously it would be nicer if we actually fix them, but for now this prevents crashes if you care about different files in the same bundle.
Calling
ObjectInfo.type
on the "library/unity default resources" asset raises the error below. This asset occurs in Hearthstone'sgameobject0
bundle, causingunityextract
to fail.