forked from StrafesNET/map-tool
Compare commits
No commits in common. "a56c114d0899de5163c2a0f38061ecb1fa88b344" and "6f5a3c517632b1f8994cd676ca927b6d694b7e8a" have entirely different histories.
a56c114d08
...
6f5a3c5176
13
src/main.rs
13
src/main.rs
@ -246,9 +246,8 @@ fn download_textures(paths:Vec<PathBuf>)->AResult<()>{
|
|||||||
}
|
}
|
||||||
let texture_list_string=texture_list.into_iter().map(|id|id.to_string()).collect::<Vec<String>>();
|
let texture_list_string=texture_list.into_iter().map(|id|id.to_string()).collect::<Vec<String>>();
|
||||||
println!("Texture list:{:?}",texture_list_string.join(" "));
|
println!("Texture list:{:?}",texture_list_string.join(" "));
|
||||||
std::fs::create_dir_all("textures/unprocessed")?;
|
|
||||||
let output=std::process::Command::new("asset-tool")
|
let output=std::process::Command::new("asset-tool")
|
||||||
.args(["download","--cookie-literal","","--output-folder","textures/unprocessed/"])
|
.args(["download","environment","RBXCOOKIE","textures/unprocessed/"])
|
||||||
.args(texture_list_string)
|
.args(texture_list_string)
|
||||||
.spawn()?
|
.spawn()?
|
||||||
.wait_with_output()?;
|
.wait_with_output()?;
|
||||||
@ -282,9 +281,8 @@ fn download_meshes(paths:Vec<PathBuf>)->AResult<()>{
|
|||||||
}
|
}
|
||||||
let mesh_list_string=mesh_list.into_iter().map(|id|id.to_string()).collect::<Vec<String>>();
|
let mesh_list_string=mesh_list.into_iter().map(|id|id.to_string()).collect::<Vec<String>>();
|
||||||
println!("Mesh list:{:?}",mesh_list_string.join(" "));
|
println!("Mesh list:{:?}",mesh_list_string.join(" "));
|
||||||
std::fs::create_dir_all("meshes/")?;
|
|
||||||
let output=std::process::Command::new("asset-tool")
|
let output=std::process::Command::new("asset-tool")
|
||||||
.args(["download","--cookie-literal","","--output-folder","meshes/"])
|
.args(["download","environment","RBXCOOKIE","meshes/"])
|
||||||
.args(mesh_list_string)
|
.args(mesh_list_string)
|
||||||
.spawn()?
|
.spawn()?
|
||||||
.wait_with_output()?;
|
.wait_with_output()?;
|
||||||
@ -335,7 +333,7 @@ fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{
|
|||||||
)?;
|
)?;
|
||||||
|
|
||||||
//write dds
|
//write dds
|
||||||
let mut dest=PathBuf::from("textures");
|
let mut dest=PathBuf::from("textures/dds");
|
||||||
dest.push(file_thing.file_name());
|
dest.push(file_thing.file_name());
|
||||||
dest.set_extension("dds");
|
dest.set_extension("dds");
|
||||||
let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?);
|
let mut writer = std::io::BufWriter::new(std::fs::File::create(dest)?);
|
||||||
@ -357,8 +355,6 @@ fn convert(file_thing:std::fs::DirEntry) -> AResult<()>{
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
fn convert_textures() -> AResult<()>{
|
fn convert_textures() -> AResult<()>{
|
||||||
std::fs::create_dir_all("textures/unprocessed")?;
|
|
||||||
std::fs::create_dir_all("textures/processed")?;
|
|
||||||
let start = std::time::Instant::now();
|
let start = std::time::Instant::now();
|
||||||
let mut threads=Vec::new();
|
let mut threads=Vec::new();
|
||||||
for entry in std::fs::read_dir("textures/unprocessed")? {
|
for entry in std::fs::read_dir("textures/unprocessed")? {
|
||||||
@ -505,7 +501,6 @@ fn recursive_vmt_loader<F:Fn(String)->AResult<Option<Vec<u8>>>>(find_stuff:&F,ma
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn extract_textures(paths:Vec<PathBuf>,vpk_paths:Vec<PathBuf>)->AResult<()>{
|
fn extract_textures(paths:Vec<PathBuf>,vpk_paths:Vec<PathBuf>)->AResult<()>{
|
||||||
std::fs::create_dir_all("textures")?;
|
|
||||||
let vpk_list:Vec<vpk::VPK>=vpk_paths.into_iter().map(|vpk_path|vpk::VPK::read(&vpk_path).expect("vpk file does not exist")).collect();
|
let vpk_list:Vec<vpk::VPK>=vpk_paths.into_iter().map(|vpk_path|vpk::VPK::read(&vpk_path).expect("vpk file does not exist")).collect();
|
||||||
for path in paths{
|
for path in paths{
|
||||||
let mut deduplicate=std::collections::HashSet::new();
|
let mut deduplicate=std::collections::HashSet::new();
|
||||||
@ -574,7 +569,7 @@ fn extract_textures(paths:Vec<PathBuf>,vpk_paths:Vec<PathBuf>)->AResult<()>{
|
|||||||
)?;
|
)?;
|
||||||
|
|
||||||
//write dds
|
//write dds
|
||||||
let mut dest=PathBuf::from("textures");
|
let mut dest=PathBuf::from("textures/dds");
|
||||||
dest.push(write_file_name);
|
dest.push(write_file_name);
|
||||||
dest.set_extension("dds");
|
dest.set_extension("dds");
|
||||||
std::fs::create_dir_all(dest.parent().unwrap())?;
|
std::fs::create_dir_all(dest.parent().unwrap())?;
|
||||||
|
Loading…
Reference in New Issue
Block a user