ue4 asset parser
Project description
pak and ue4 asset parser
Usages
Basic Usages
from UE4Parse.Assets.Objects.FGuid import FGuid
from UE4Parse.Provider import DefaultFileProvider, MappingProvider
from UE4Parse.Versions import EUEVersion, VersionContainer
from UE4Parse.Encryption import FAESKey
import logging
logging.getLogger("UE4Parse").setLevel(logging.INFO) # set logging level
path = r"C:\Program Files\Epic Games\Fortnite\FortniteGame\Content\Paks"
aeskeys = {
FGuid(0,0,0,0): FAESKey("0xFE478B39DF1B1D4E8D8DFD38272F216DBE933E7F80ADCC45DC4108D70428F37D"),
}
import gc; gc.disable() # temporarily disabling garbage collector gives a huge performance boost
provider = DefaultFileProvider(path, VersionContainer(EUEVersion.LATEST))
provider.initialize()
provider.submit_keys(aeskeys) # mount files
gc.enable() # enable garbage collector again
provider.mappings = MappingProvider()
package_path = 'FortniteGame/Content/Animation/Game/MainPlayer/Skydive/ParaGlide/MechanicalEngineer/BS_MechanicalEngineer_Into_NoPack_GLIDER'
package = provider.try_load_package(package_path)
if package is not None:
package_dict = package.get_dict() # get json serializable dict
# write package_dict to json
import json
with open('something.json', 'w') as f:
json.dump(package_dict, f, indent=4)
Converting Textures
if texture := package.find_export_of_type("Texture2D"):
image = texture.decode() # returns PIL Image object
image.save("cool_image.png", "PNG") # save image
# for more information refer to https://pillow.readthedocs.io/en/stable/reference/Image.html?highlight=Image#PIL.Image.Image
Links
Notes for Developers
-
Developers can use pyximport for development purposes
import pyximport pyximport.install()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
UE4Parse-0.0.1.tar.gz
(123.6 kB
view hashes)
Built Distribution
Close
Hashes for UE4Parse-0.0.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7f21a0be600ee97c0bd3bd7eb03d6c133926ee290e9ddc7891ac9889600a605 |
|
MD5 | 5bdb65226a902ed23dfba4f57318ace4 |
|
BLAKE2b-256 | 1de4d160affd38b4806026a33b1bc9f531ea9554ccebc463e11250b32f1b3360 |