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)) 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())