Skip to content

Commit

Permalink
Emit material name for the level OBJ
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Dec 15, 2023
1 parent 8302320 commit 523fdfc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/convert/level_obj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,11 @@ pub fn save(path: &Path, level: &Level, config: &Config) {
writeln!(dest, "v {} {} {}", v[0], v[1], v[2]).unwrap();
}
bar.set_job_title("Faces:");
if config.palette.is_some() {
let mtl_path = path.with_extension("mtl");
let mat_name = mtl_path.file_name().unwrap().to_str().unwrap();
writeln!(dest, "mtllib {}", mat_name).unwrap();
}
writeln!(dest).unwrap();
for (i, group) in groups.iter().enumerate() {
writeln!(dest, "usemtl t{}", i).unwrap();
Expand Down

0 comments on commit 523fdfc

Please sign in to comment.