diff --git a/obj2mjcf/cli.py b/obj2mjcf/cli.py index 77c77ff..5b2b31a 100644 --- a/obj2mjcf/cli.py +++ b/obj2mjcf/cli.py @@ -239,6 +239,8 @@ def process_obj(filename: Path, args: Args) -> None: sub_mtls = [smtl] mtls = [Material.from_string(smtl)] + mtls = list({obj.name: obj for obj in mtls}.values()) + # Delete any MTL files that were created during trimesh processing, if any. for file in [ x for x in work_dir.glob("**/*") if x.is_file() and "material_0" in x.name