mirror of
https://github.com/IllusionMan1212/3dobs.git
synced 2026-10-24 10:12:35 +00:00
fix(obj): load all files in mtllib statement
This commit is contained in:
+10
-8
@@ -350,14 +350,16 @@ pub fn load_obj(obj_path: &PathBuf, file: std::fs::File) -> Result<Object, Box<d
|
|||||||
indices_counter += face.len() as u32;
|
indices_counter += face.len() as u32;
|
||||||
}
|
}
|
||||||
Some(ObjToken::MaterialLib) => {
|
Some(ObjToken::MaterialLib) => {
|
||||||
let material_path = obj_path.parent().unwrap().join(iter.next().unwrap_or(""));
|
for matlib in iter {
|
||||||
let new_materials = parse_mtl(&material_path);
|
let material_path = obj_path.parent().unwrap().join(matlib);
|
||||||
match new_materials {
|
let new_materials = parse_mtl(&material_path);
|
||||||
Ok(m) => {
|
match new_materials {
|
||||||
materials.extend(m);
|
Ok(m) => {
|
||||||
},
|
materials.extend(m);
|
||||||
Err(e) => {
|
},
|
||||||
error!("Failed to parse mtl file {:?}: {}", material_path, e);
|
Err(e) => {
|
||||||
|
error!("Failed to parse mtl file {:?}: {}", material_path, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user