diff --git a/bin/convert/level_obj.rs b/bin/convert/level_obj.rs index 2e33afb..c014eb8 100644 --- a/bin/convert/level_obj.rs +++ b/bin/convert/level_obj.rs @@ -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();