Skip to content

Commit

Permalink
Bugfix.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinzakka committed Jul 4, 2022
1 parent c8a6095 commit c185b0b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion obj2mjcf/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.16"
__version__ = "0.0.17"
9 changes: 7 additions & 2 deletions obj2mjcf/_cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""A CLI for processing composite Wavefront OBJ files into a MuJoCo-conducive format."""

import enum
import logging
import os
Expand Down Expand Up @@ -343,7 +345,10 @@ def process_obj(filename: Path, args: Args) -> None:
with open(work_dir / f"{mtl_name}.mtl", "w") as f:
f.write("".join(smtl))
# Edit the mtllib line to point to the new MTL file.
savename = str(work_dir / f"{filename.stem}_{i}.obj")
if len(sub_mtls) > 1:
savename = str(work_dir / f"{filename.stem}_{i}.obj")
else:
savename = str(work_dir / f"{filename.stem}.obj")
with open(savename, "r") as f:
lines = f.readlines()
for i, line in enumerate(lines):
Expand Down Expand Up @@ -493,7 +498,7 @@ def process_obj(filename: Path, args: Args) -> None:


def main() -> None:
args = dcargs.parse(Args)
args = dcargs.cli(Args, description=__doc__)

if args.verbose:
logging.getLogger().setLevel(logging.INFO)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
readme = f.read()

core_requirements = [
"trimesh==3.12.5",
"trimesh>=3.12.5",
"Pillow>=9.1.1",
"mujoco>=2.2.0",
"dcargs>=0.0.21",
"dcargs>=0.1.2",
"numpy",
"termcolor",
"lxml",
Expand Down

0 comments on commit c185b0b

Please sign in to comment.