unreal_asset

Crates.iounreal_asset
lib.rsunreal_asset
version0.1.16
sourcesrc
created_at2023-02-02 14:41:27.022014
updated_at2023-07-17 09:57:00.023004
descriptionUnreal Engine 4/5 game asset serialization library.
homepagehttps://github.com/AstroTechies/unrealmodding
repository
max_upload_size
id774817
size1,230,850
(konsti219)

documentation

https://docs.rs/unreal_asset

README

unreal_asset

The unreal_asset crate is a Rust library that allows parsing of Unreal Engine binary asset files.

Documentation

Crate documentation is published to docs.rs/unreal_asset.

Unreal Engine binary asset files

Unreal Engine binary asset files are usually stored with the following extensions:

  • .uasset - The file that has asset metadata as well as some information, if the game is built without split bulk data files, then it also contains all of asset data.
  • .uexp - If the game is built with split bulk data files, it contains binary data related to components, etc.
  • .umap - Same as .uasset but for maps/levels.
  • .usmap - Mapping files for reading unversioned assets.

These files are what stores most of the game's assets and what you might want to modify to mod a specific game.

Usage

The crate can be added to a Rust project as a dependency by running the command cargo add unreal_asset.

Features

  • oodle - allows reading Oodle compressed asset files

Examples

The example code provided below demonstrates how to use the unreal_asset crate to read an asset file that was cooked for a game with split bulk files enabled.

use unreal_asset::{engine_version::EngineVersion, Asset};
use std::{
    fs::File,
    io::{Cursor, Read},
    path::Path,
};

let mut data_file = File::open("NPC_Onop_IO_Bech.uasset")?;
let mut bulk_file = File::open("NPC_Onop_IO_Bech.uexp")?;

let asset = Asset::new(data_file, Some(bulk_file), EngineVersion::VER_UE4_25)?;
println!("{:#?}", asset);

The tests directory contains several tests that demonstrate how to use the crate to work with uasset files.

License

This library is distributed under the terms of the MIT license. See the LICENSE file for details.

Commit count: 0

cargo fmt