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:
+3
-1
@@ -350,7 +350,8 @@ 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 material_path = obj_path.parent().unwrap().join(matlib);
|
||||||
let new_materials = parse_mtl(&material_path);
|
let new_materials = parse_mtl(&material_path);
|
||||||
match new_materials {
|
match new_materials {
|
||||||
Ok(m) => {
|
Ok(m) => {
|
||||||
@@ -361,6 +362,7 @@ pub fn load_obj(obj_path: &PathBuf, file: std::fs::File) -> Result<Object, Box<d
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Some(ObjToken::MaterialUsage) => {
|
Some(ObjToken::MaterialUsage) => {
|
||||||
// Split into meshes by material usage
|
// Split into meshes by material usage
|
||||||
let name = {
|
let name = {
|
||||||
|
|||||||
Reference in New Issue
Block a user