diff --git a/python/mujoco/functions.cc b/python/mujoco/functions.cc index 14b9fc15..767ed879 100644 --- a/python/mujoco/functions.cc +++ b/python/mujoco/functions.cc @@ -52,6 +52,27 @@ PYBIND11_MODULE(_functions, pymodule) { // Virtual file system // Skipped entire section + // Asset cache + Def(pymodule, [](void* cache) { + return mj_getCacheSize(static_cast(cache)); + }); + + Def(pymodule, [](void* cache) { + return mj_getCacheCapacity(static_cast(cache)); + }); + + Def(pymodule, [](void* cache, std::size_t size) { + return mj_setCacheCapacity(static_cast(cache), size); + }); + + Def(pymodule, []() { + return static_cast(mj_getCache()); + }); + + Def(pymodule, [](void* cache) { + return mj_clearCache(static_cast(cache)); + }); + // Parse and compile // Skipped: mj_loadXML (have MjModel.from_xml_string) DEF_WITH_OMITTED_PY_ARGS(traits::mj_saveLastXML, "error", "error_sz")( diff --git a/python/mujoco/structs.cc b/python/mujoco/structs.cc index 918a6e7c..6f157d02 100644 --- a/python/mujoco/structs.cc +++ b/python/mujoco/structs.cc @@ -16,6 +16,7 @@ #include +#include #include #include #include