Do not strip the path when compiling an mjSpec.
The path has already been stripped while parsing. This will enable prefixes that contain a `/` while attaching. Also use `spec.meshdir` for asset paths in `spec.to_zip()`. PiperOrigin-RevId: 794573523 Change-Id: Ic36bb641c3d72848399006cf718afd8542e91ed4
This commit is contained in:
committed by
Copybara-Service
parent
6a9e68a542
commit
cc52d0242b
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user