MinshuG/pyUE4Parse

example code to parse a .uasset file

Closed this issue · 1 comments

Can't seem to find the starting place. The example code presumes a pak or a "game", but I want to parse .uasset files.

# parameter passed is something like /path/to/a/file/file.uasset
path = sys.argv[1]
provider = DefaultFileProvider(os.path.dirname(path), VersionContainer(EUEVersion.LATEST))
provider.initialize()

package_path = os.path.basename(path)
#stream = provider.open_stream(package_path)
#package = provider.try_load_package(stream)
package = provider.try_load_package(package_path)    
if package is not None:
    package_dict = package.get_dict() # get json serializable dict

Use LegacyPackageReader directly

class LegacyPackageReader(Package):