From 8bd0765290ed2b9f3aa03fa889b6ab4898d575b1 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 10 Jan 2024 15:27:14 -0800 Subject: [PATCH] use search paths --- src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index fc08d2f..803d76e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1087,8 +1087,8 @@ fn get_some_texture(material:vmt_parser::material::Material)->AResultAResult>>>(find_stuff:&F,search_name:String)->AResult>{ + println!("looking for {}",search_name); if let Some(stuff)=find_stuff(search_name)?{ - //println!("woahh its a vmt {:?}",search_name); //decode vmt and then write let stuff=String::from_utf8(stuff)?; let material=vmt_parser::from_str(stuff.as_str())?; @@ -1149,9 +1149,11 @@ fn extract_textures(paths:Vec,vpk_path:std::path::PathBuf)-> (Ok(mdl),Ok(vvd),Ok(vtx))=>{ let model=vmdl::Model::from_parts(mdl,vtx,vvd); for texture in model.textures(){ - println!("prop texture={}",texture.name.as_str()); - println!("search paths={:?}",texture.search_paths); - deduplicate.insert(std::path::PathBuf::from(texture.name.as_str())); + for search_path in &texture.search_paths{ + let mut path=std::path::PathBuf::from(search_path.as_str()); + path.push(texture.name.as_str()); + deduplicate.insert(path); + } } }, _=>print!("model_name={} error",model_name),