Expand description
§The Rust uasset Library
uasset
is a pure Rust implementation of the Unreal Engine .uasset
file format.
It gives you direct access to fields & values in the uasset format, and is intended
to allow you to build tools outside of the Unreal Editor to work with uassets.
§Usage
To use uasset
, first add this to your Cargo.toml
:
[dependencies]
uasset = "^0.2"
Then import AssetHeader
into your program:
use uasset::AssetHeader;
Finally, parse a file using AssetHeader::new
.
§Example
let file = File::open(path)?;
let package = AssetHeader::new(&file)?;
for import in package.package_import_iter() {
println!("Import: {}", import);
}
§Crate features
commandline-tool
- Allows the building of auasset
command line tool that can be used to inspect specific assets.
Structs§
- Archive
- Asset
Header - A table of contents for a uasset loaded from disk, containing all the shared package summary information.
This roughly maps to
FPackageFileSummary
in Engine/Source/Runtime/CoreUObject/Public/UObject/PackageFileSummary.h, except we load some of the indirectly referenced data (i.e. names, imports, exports). - Import
Iterator - Iterator over the imported packages in a given
AssetHeader
- Invalid
Name Index Error - Error when attempting to resolve an index
- Name
Reference - A reference to a name in the
AssetHeader::names
name table. You can useAssetHeader::resolve_name
to get a human-readable string from aNameReference
. It only makes sense to compareNameReference
s from the sameAssetHeader
. - Object
Import - A reference to an object in another package. Typically accessed through
AssetHeader::package_import_iter
, but you can also manually resolve theNameReference
s. (C++ name:FObjectImport
) - Thumbnail
Info - Represents the metadata about a thumbnail for an asset, stored behind [
AssetHeader::thumbnail_table_offsets
] (seeThumbnailTools::LoadThumbnailsFromPackageInternal
)
Enums§
- Custom
Version Serialization Format - The format of an asset’s custom versions, derived from
legacy_version
(seeFCustomVersionContainer::Serialize
) - Error
- Errors from parsing an asset
- Object
Import Outer - A reference to either an import or an export in the asset.
- Object
Version - Maps to
EUnrealEngineObjectUE4Version
in Engine/Source/Runtime/Core/Public/UObject/ObjectVersion.h – this tracks the various versions to the core serialized object format. - Object
VersionU E5 - Maps to
EUnrealEngineObjectUE5Version
in Engine/Source/Runtime/Core/Public/UObject/ObjectVersion.h – this tracks the various versions to the core serialized object format. - Package
Flags - Maps to
EPackageFlags
in Engine/Source/Runtime/CoreUObject/Public/UObject/ObjectMacros.h. TheUnusedN
entries exist for completeness, presumably those entries were used in the past.
Type Aliases§
- Result
- Results from parsing a uasset