diff --git a/python/mujoco/__init__.py b/python/mujoco/__init__.py index de578935..d800c0b0 100644 --- a/python/mujoco/__init__.py +++ b/python/mujoco/__init__.py @@ -105,7 +105,7 @@ def to_zip(spec: _specs.MjSpec, file: Union[str, IO[bytes]]) -> None: file = open(file, 'wb') with zipfile.ZipFile(file, 'w') as zip_file: for filename, contents in files_to_zip.items(): - zip_info = zipfile.ZipInfo(os.path.join(spec.modelname, filename)) + zip_info = zipfile.ZipInfo(os.path.join(spec.meshdir, filename)) zip_file.writestr(zip_info, contents) diff --git a/python/mujoco/specs_wrapper.cc b/python/mujoco/specs_wrapper.cc index 18ffd3b5..3ca6d3c5 100644 --- a/python/mujoco/specs_wrapper.cc +++ b/python/mujoco/specs_wrapper.cc @@ -98,8 +98,7 @@ raw::MjModel* MjSpec::Compile() { mjVFS vfs; mj_defaultVFS(&vfs); for (const auto& asset : assets) { - std::string buffer_name = - _impl::StripPath(py::cast(asset.first).c_str()); + std::string buffer_name = py::cast(asset.first).c_str(); std::string buffer = py::cast(asset.second); const int vfs_error = InterceptMjErrors(mj_addBufferVFS)( &vfs, buffer_name.c_str(), buffer.c_str(), buffer.size());