From fded04f5045cae56e5d84fb45db453e8043e4001 Mon Sep 17 00:00:00 2001 From: AlexKaravaev <30314738+AlexKaravaev@users.noreply.github.com> Date: Tue, 26 Mar 2024 23:30:25 +0100 Subject: [PATCH] Don't delete material_0 texture if exists (#30) --- obj2mjcf/cli.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obj2mjcf/cli.py b/obj2mjcf/cli.py index 93885f1..80b433e 100644 --- a/obj2mjcf/cli.py +++ b/obj2mjcf/cli.py @@ -243,7 +243,9 @@ def process_obj(filename: Path, args: Args) -> None: # 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 + x + for x in work_dir.glob("**/*") + if x.is_file() and "material_0" in x.name and not x.name.endswith(".png") ]: file.unlink()