You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2fec922
Browse filesBrowse the repository at this point in the historyBrowse files
This change introduces a new registration function
mjp_registerArchiveResourceProvider for mjpResourceProvider plugins.
These special resource providers are meant to address asset fetching
from within an "archive" such as an mjz, but it's easy to imagine other
extensions such as reference buffers within a binary format, or a tar
file.
Assets can be addressed via regular path syntax anywhere filepaths are
used in MuJoCo:
```
<mesh name="chair_leg" file="a/b/c.mjz/meshes/chair.obj"/>
```
By consequence, this allows us to remove the shared VFS requirement
between model parsing and compilation for MJZ.
```
# BEFORE
with mujoco.MjVfs() as vfs:
spec = mujoco.MjSpec.from_file("some_asset.mjz", vfs=vfs)
model = spec.compile(vfs=vfs)
# AFTER
spec = mujoco.MjSpec.from_file("some_asset.mjz")
model = spec.compile()
```
A VFS can still be used if you need tight control over rsource
management in tight loops compiling a lot of models, but we hope to
address that specific usecase in a follow up soon.
PiperOrigin-RevId: 983512715
Change-Id: I639bd80ca7edbec379ccf7aba667f742ea311323
doc='Globally register an archive resource provider. This function is thread-safe. provider->prefix specifies the filename extension(s) (e.g. .mjz|.zip).', # pylint: disable=line-too-long
0 commit comments