Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading package_dict from Single .uasset Without Provider? #17

Open
k----n opened this issue Jan 17, 2024 · 2 comments
Open

Loading package_dict from Single .uasset Without Provider? #17

k----n opened this issue Jan 17, 2024 · 2 comments

Comments

@k----n
Copy link

k----n commented Jan 17, 2024

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

class LegacyPackageReader(Package):


To use initialize LegacyPackageReader, you need a to pass a BinaryStream.

The first issue is that by directly initializing a BinaryStream for the LegacyPackageReader, you will not get the mappings attribute in the BinaryStream.

self.reader.mappings = uasset.mappings

The second issue is although it seems like you can initialize LegacyPackageReader without a provider, it will error out because set_ar_verion uses None and has no Versions attribute.

self.reader.set_ar_version(provider.Versions.UEVersion)

@mortalis13
Copy link

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.

@mortalis13
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants