From 273282488a489cfdf2be3fe0d37f592215470ba5 Mon Sep 17 00:00:00 2001 From: AlexKaravaev Date: Tue, 26 Mar 2024 09:04:16 +0100 Subject: [PATCH] Don't delete material_0 texture if exists --- 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()