From b667bf050af35b2f654ab0416d2fc553483414cb Mon Sep 17 00:00:00 2001 From: Ben Bolte Date: Tue, 20 Aug 2024 11:30:19 -0700 Subject: [PATCH] fix mesh extension bug (#305) --- store/app/crud/urdf.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/store/app/crud/urdf.py b/store/app/crud/urdf.py index f0e961e0..421480da 100644 --- a/store/app/crud/urdf.py +++ b/store/app/crud/urdf.py @@ -88,7 +88,6 @@ async def set_urdf( tmesh = trimesh.load(data, file_type=suffix) assert isinstance(tmesh, trimesh.Trimesh) except Exception: - print(data.read()) raise BadArtifactError(f"Invalid mesh file: {name}") meshes.append((name, tmesh)) @@ -106,7 +105,6 @@ async def set_urdf( raise BadArtifactError("Mesh element missing filename attribute.") filepath = Path(filename).relative_to(".") if filepath not in mesh_names: - print(mesh_names) raise BadArtifactError(f"Mesh referenced in URDF was not uploaded: {filepath}") mesh_names.remove(filepath) mesh.set("filename", str(filepath.with_suffix(".obj"))) @@ -119,7 +117,8 @@ async def set_urdf( for name, tmesh in meshes: out_file = io.BytesIO() tmesh.export(out_file, file_type="obj") - info = tarfile.TarInfo(name) + obj_name = Path(name).with_suffix(".obj").as_posix() + info = tarfile.TarInfo(obj_name) info.size = out_file.tell() out_file.seek(0) tar.addfile(info, out_file)