Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mtlファイルの指定とグループ作成 (#630) #633

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion nusamai/src/sink/obj/obj_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@

mesh_data.push((feature_id, mesh, vertex_offset, uv_offset));
}

let mut obj_writer = BufWriter::new(File::create(&obj_path)?);

writeln!(obj_writer, "mtllib {}.mtl", file_name)?;

Check warning on line 52 in nusamai/src/sink/obj/obj_writer.rs

View check run for this annotation

Codecov / codecov/patch

nusamai/src/sink/obj/obj_writer.rs#L52

Added line #L52 was not covered by tests

for vertex in &all_vertices {
writeln!(obj_writer, "v {} {} {}", vertex[0], vertex[1], vertex[2])?;
}
Expand All @@ -63,6 +65,7 @@

if is_split {
local_obj.push(format!("o {}", feature_id));
local_obj.push(format!("g {}", feature_id));

Check warning on line 68 in nusamai/src/sink/obj/obj_writer.rs

View check run for this annotation

Codecov / codecov/patch

nusamai/src/sink/obj/obj_writer.rs#L68

Added line #L68 was not covered by tests
}

for (material_key, indices) in &mesh.primitives {
Expand Down