Add MjSpec.encode method.

PiperOrigin-RevId: 907177387
Change-Id: I65800298798037c4a0c0cd79ec86706be67db51e
This commit is contained in:
Sam Haves
2026-04-28 14:22:11 -07:00
committed by Copybara-Service
parent ace90c00b9
commit d92fe0810c
5 changed files with 119 additions and 0 deletions
+6
View File
@@ -547,6 +547,12 @@ Compiled ``MjSpec`` objects can be saved to XML string with the ``to_xml()`` met
</worldbody>
</mujoco>
Alternatively, the spec can be saved directly to a file using ``encode()``:
.. code-block:: python
spec.encode('model.xml', model)
Attachment
----------