Add plugin support to Python bindings.

PiperOrigin-RevId: 480675078
Change-Id: I2967654b6662efced8ae62cae9b03c6c8e65c67c
This commit is contained in:
Alessio Quaglino
2022-10-12 11:29:37 -07:00
committed by Copybara-Service
parent 23e4c03efc
commit 95fe2fbc40
5 changed files with 76 additions and 3 deletions
+10
View File
@@ -54,5 +54,15 @@ if _MUJOCO_GL not in ('disable', 'disabled', 'off', 'false', '0'):
from mujoco.glfw import GLContext
HEADERS_DIR = os.path.join(os.path.dirname(__file__), 'include/mujoco')
PLUGINS_DIR = os.path.join(os.path.dirname(__file__), 'plugin')
PLUGIN_HANDLES = []
def _load_all_bundled_plugins():
for directory, _, filenames in os.walk(PLUGINS_DIR):
for filename in filenames:
PLUGIN_HANDLES.append(ctypes.CDLL(os.path.join(directory, filename)))
_load_all_bundled_plugins()
__version__ = mj_versionString() # pylint: disable=undefined-variable