MinshuG / pyUE4Parse

ue4 asset parser/reader
MIT License
47 stars 15 forks source link

Error: Can not loadUE3 packages #21

Open Sven-vh opened 6 months ago

Sven-vh commented 6 months ago

I created a basic blueprint in the latest Unreal version, version 5.4.1, but when I try to open it I get an error: An error occurred: Can not load UE3 packages.

uasset_path is the path to a .uasset file.

def get_asset_type(uasset_path):
    try:
        print(f"Reading uasset file: {uasset_path}")
        provider = DefaultFileProvider(os.path.dirname(uasset_path), VersionContainer(EUEVersion.LATEST))
        provider.initialize()

        uasset_stream = BinaryStream(uasset_path)

        package_reader = LegacyPackageReader(uasset_stream, None, provider=provider)
        package = package_reader.read_package()
        primary_export = package.exports[0]
        return primary_export.export_type
    except Exception as e:
        print(f"An error occurred: {e}")
        return None
MinshuG commented 6 months ago

UE5.4 is probably too new for pyue4parse and this package is not updated anymore. use this https://github.com/FabianFG/CUE4Parse

Sven-vh commented 6 months ago

UE5.4 is probably too new for pyue4parse and this package is not updated anymore. use this https://github.com/FabianFG/CUE4Parse

Thanks for the quick response, the problem with CUE4Parse is that it's for C#. I'm working in Python. The only thing I need to know is what type of asset it is, is there a workaround for this?

MinshuG commented 6 months ago

Is the asset you are trying to read cooked?

Sven-vh commented 5 months ago

Is the asset you are trying to read cooked?

Sorry for the late reply but, No, they are not cooked. Does this make it easier?

MinshuG commented 5 months ago

Library is only tested with cooked assets