#assets #loading #tf2 #steam #texture #loader #bsp

tf-asset-loader

Utility for loading assets from tf2 data files

9 releases

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

#282 in Embedded development

Download history 157/week @ 2024-09-01 6/week @ 2024-09-08 26/week @ 2024-09-15 14/week @ 2024-09-22 30/week @ 2024-09-29 1/week @ 2024-10-06 102/week @ 2024-12-08 53/week @ 2024-12-15

155 downloads per month
Used in vmdl

MIT license

13KB
263 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, data embedded in vpk files and data embedded in bsp maps.


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–16MB
~152K SLoC