Open k----n opened 10 months ago
Check this info: #23 I also needed to check a single asset, so I modified some code. Worked for me, exporing a Texture2D from UE 4.26 assets.
ok also #14 could help, setting BinaryStream.mappings
to None
explicitly and creating provider passing the path to the uasset
.
So the DefaultFileProvider
acts like a generic container I guess, not only dedicated to .pak
or .utoc
.
How can you extract the package_dict from a single .uasset file? The .uasset file lives in a path like:
/SpaceTradingShooter/Content/Blueprints/AI/BB_AI_Ship.uasset
This is related to #11 which writes:
Use LegacyPackageReader directly https://github.com/MinshuG/pyUE4Parse/blob/1c7b64cf95be6c234f6f45e3dbd5f9e84b25f99f/UE4Parse/Assets/PackageReader.py#L80
To use initialize
LegacyPackageReader
, you need a to pass aBinaryStream
.The first issue is that by directly initializing a
BinaryStream
for theLegacyPackageReader
, you will not get the mappings attribute in theBinaryStream
. https://github.com/MinshuG/pyUE4Parse/blob/1c7b64cf95be6c234f6f45e3dbd5f9e84b25f99f/UE4Parse/Assets/PackageReader.py#L90The second issue is although it seems like you can initialize
LegacyPackageReader
without a provider, it will error out becauseset_ar_verion
uses None and has no Versions attribute. https://github.com/MinshuG/pyUE4Parse/blob/1c7b64cf95be6c234f6f45e3dbd5f9e84b25f99f/UE4Parse/Assets/PackageReader.py#L91