Roll back VFS refactor due internal breakages

PiperOrigin-RevId: 856273160
Change-Id: I4097e05ed4e48ebee05b4347d0f227d4f39c1b09
This commit is contained in:
Google DeepMind
2026-01-14 10:37:31 -08:00
committed by Copybara-Service
parent c996f288e1
commit cbc1136502
12 changed files with 412 additions and 823 deletions
-19
View File
@@ -1357,25 +1357,6 @@ The VFS must first be allocated using :ref:`mj_defaultVFS` and must be freed wit
Initialize an empty VFS, :ref:`mj_deleteVFS` must be called to deallocate the VFS.
.. _mj_mountVFS:
`mj_mountVFS <#mj_mountVFS>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. mujoco-include:: mj_mountVFS
Mount a ResourceProvider to handle file operations under the given path; return 0: success,
2: repeated name, -1: invalid resource provider.
.. _mj_unmountVFS:
`mj_unmountVFS <#mj_unmountVFS>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. mujoco-include:: mj_unmountVFS
Unmount a previously mounted ResourceProvider; return 0: success, -1: not found in VFS.
.. _mj_addFileVFS:
`mj_addFileVFS <#mj_addFileVFS>`__
-2
View File
@@ -45,8 +45,6 @@ General
See :ref:`rangefinder<sensor-rangefinder>` for details.
- Cameras now have an :ref:`output<body-camera-output>` attribute, parsed into the ``mjModel.cam_output`` bitfield.
Unused by the renderer, it serves as a convenient location to store a camera's supported output types.
- Added :ref:`mj_mountVFS` and :ref:`mj_unmountVFS` functions for mounting a custom VFS provider. Mounting Allows
providers to be used to open/read/close resources dynamically at arbitrary paths.
- Non-breaking ABI changes:
- The type of the ``sig`` (signature) argument of :ref:`mj_stateSize` and related functions has been changed from
-5
View File
@@ -1619,7 +1619,6 @@ typedef struct mjModel_ mjModel;
struct mjResource_ {
char* name; // name of resource (filename, etc)
void* data; // opaque data pointer
mjVFS* vfs; // pointer to the VFS
char timestamp[512]; // timestamp of the resource
const struct mjpResourceProvider* provider; // pointer to the provider
};
@@ -1629,8 +1628,6 @@ struct mjpResourceProvider {
mjfOpenResource open; // opening callback
mjfReadResource read; // reading callback
mjfCloseResource close; // closing callback
mjfMountResource mount; // mounting callback (optional)
mjfUnmountResource unmount; // unmounting callback (optional)
mjfResourceModified modified; // resource modified callback (optional)
void* data; // opaque data pointer (resource invariant)
};
@@ -3087,8 +3084,6 @@ typedef struct mjvFigure_ mjvFigure;
//----------------------------- MJAPI FUNCTIONS --------------------------------
void mj_defaultVFS(mjVFS* vfs);
int mj_mountVFS(mjVFS* vfs, const char* filepath, const mjpResourceProvider* provider);
int mj_unmountVFS(mjVFS* vfs, const char* filename);
int mj_addFileVFS(mjVFS* vfs, const char* directory, const char* filename);
int mj_addBufferVFS(mjVFS* vfs, const char* name, const void* buffer, int nbuffer);
int mj_deleteFileVFS(mjVFS* vfs, const char* filename);