Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinzakka committed Feb 12, 2024
1 parent b92a6f9 commit 7e2bdef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions obj2mjcf/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,15 @@ def process_obj(filename: Path, args: Args) -> None:

if isinstance(mesh, trimesh.base.Trimesh):
# No submeshes, just save the mesh.
savename = str(work_dir / f"{filename.stem}.obj")
savename = work_dir / f"{filename.stem}.obj"
logging.info(f"Saving mesh {savename}")
mesh.export(savename, include_texture=True, header=None)
mesh.export(savename.as_posix(), include_texture=True, header=None)
else:
logging.info("Grouping and saving submeshes by material")
for i, geom in enumerate(mesh.geometry.values()):
savename = str(work_dir / f"{filename.stem}_{i}.obj")
savename = work_dir / f"{filename.stem}_{i}.obj"
logging.info(f"Saving submesh {savename}")
geom.export(savename, include_texture=True, header=None)
geom.export(savename.as_posix(), include_texture=True, header=None)

# Edge case handling where the material file can have many materials but the OBJ
# itself only references one. In that case, we trim out the extra materials and
Expand Down
1 change: 0 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pathlib
import shutil
import subprocess

# Path to the directory containing this file.
Expand Down

0 comments on commit 7e2bdef

Please sign in to comment.