From 33179219990046ce2ccdb8ede75e6dc694e315aa Mon Sep 17 00:00:00 2001 From: Michael Moss Date: Mon, 15 Jun 2026 06:49:58 -0700 Subject: [PATCH] Add Studio assets into the python packaging. PiperOrigin-RevId: 932432607 Change-Id: Id5122f3655c519f185b5647f3fb92f3ed54ba82c --- python/setup.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/python/setup.py b/python/setup.py index a35ff32e..e2babe55 100644 --- a/python/setup.py +++ b/python/setup.py @@ -159,6 +159,7 @@ class BuildCMakeExtension(build_ext.build_ext): self._copy_external_libraries() self._copy_mujoco_headers() self._copy_plugin_libraries() + self._copy_studio_assets() if self._is_apple: self._copy_mjpython() @@ -222,6 +223,26 @@ class BuildCMakeExtension(build_ext.build_ext): os.path.join(directory, filename), os.path.join(dst, filename) ) + def _copy_studio_assets(self): + assets_src = None + for directory, subdirs, _ in os.walk(os.environ[MUJOCO_PATH]): + if 'assets' in subdirs: + candidate = os.path.join(directory, 'assets') + if os.path.exists(os.path.join(candidate, 'fontawesome-webfont.ttf')): + assets_src = candidate + break + + if assets_src: + dst = os.path.join( + os.path.dirname(self.get_ext_fullpath(self.extensions[0].name)), + 'experimental/studio/assets', + ) + if os.path.exists(dst): + shutil.rmtree(dst) + shutil.copytree(assets_src, dst) + else: + print("Warning: Studio assets not found in MUJOCO_PATH. Skipping.") + def _copy_mjpython(self): src_dir = os.path.join(os.path.dirname(__file__), 'mujoco/mjpython') dst_contents_dir = os.path.join(