#assets #loading #tf2 #steam

tf-asset-loader

Utility for loading assets from tf2 data files

8 releases

0.1.7 Sep 2, 2024
0.1.6 Aug 30, 2024
0.1.5 Dec 26, 2023

#206 in Compression


Used in vmdl

MIT license

13KB
259 lines

tf-asset-loader

Utility for loading assets from tf2 data files.

Supports loading assets like models and textures from the tf2 data directory. The tf2 data directory should be automatically detected when installed to steam, or you can use the TF_DIR environment variable to overwrite the data directory.

Supports loading both plain file data and data embedded in vpk files.


lib.rs:

Utility for loading assets from tf2 data files.

Supports loading assets like models and textures from the tf2 data directory. The tf2 data directory should be automatically detected when installed to steam, or you can use the TF_DIR environment variable to overwrite the data directory.

Supports loading both plain file data and data embedded in vpk files.

#
fn main() -> Result<(), LoaderError> {
    let loader = Loader::new()?;
    if let Some(model) = loader.load("models/props_gameplay/resupply_locker.mdl")? {
        println!("resupply_locker.mdl is {} bytes large", model.len());
    }
    Ok(())
}

Dependencies

~4–6.5MB
~111K SLoC