#assets #loading #tf2 #steam #texture #loader #env-var

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

#563 in Embedded development

Download history 74/week @ 2024-08-24 189/week @ 2024-08-31 14/week @ 2024-09-07 26/week @ 2024-09-14 14/week @ 2024-09-21 28/week @ 2024-09-28 3/week @ 2024-10-05

369 downloads per month
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
~110K SLoC