From 20cffc6bb1c1cbbfadad51cf0f14f5044f673403 Mon Sep 17 00:00:00 2001 From: Antoine Bussy Date: Fri, 15 Nov 2024 14:04:56 +0100 Subject: [PATCH 1/2] meshcat_visualizer: force type of image paths to pathlib.Path --- bindings/python/pinocchio/visualize/meshcat_visualizer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/python/pinocchio/visualize/meshcat_visualizer.py b/bindings/python/pinocchio/visualize/meshcat_visualizer.py index 11784cb0d3..22f0976a4d 100644 --- a/bindings/python/pinocchio/visualize/meshcat_visualizer.py +++ b/bindings/python/pinocchio/visualize/meshcat_visualizer.py @@ -143,9 +143,9 @@ def __init__(self, dae_path: str, cache: Optional[Set[str]] = None) -> None: # Encode texture in base64 img_path_abs = img_path - if not img_path.is_absolute(): + if not Path(img_path).is_absolute(): img_path_abs = os.path.normpath(dae_dir / img_path_abs) - if not img_path_abs.is_file(): + if not Path(img_path_abs).is_file(): raise UserWarning(f"Texture '{img_path}' not found.") with Path(img_path_abs).open("rb") as img_file: img_data = base64.b64encode(img_file.read()) From e774dde39f1d6c35902f6a5c2a7ffb78ab67d3fb Mon Sep 17 00:00:00 2001 From: Antoine Bussy Date: Fri, 15 Nov 2024 14:51:18 +0100 Subject: [PATCH 2/2] Update CHANGELOG. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2942a4b95c..aaaf6eeb6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Fix mjcf parsing of armature and of the default tag in models ([#2477](https://github.com/stack-of-tasks/pinocchio/pull/2477)) - Fix undefined behavior when using the site attribute in mjcf ([#2477](https://github.com/stack-of-tasks/pinocchio/pull/2477)) +- Fix the type of image paths when loading textures in the meshcat visualizer ([#2478](https://github.com/stack-of-tasks/pinocchio/pull/2478)) ### Changed - On GNU/Linux and macOS, hide all symbols by default ([#2469](https://github.com/stack-of-tasks/pinocchio/pull/2469))