Skip to content

Commit fb30e0e

Browse files
quaglacopybara-github
authored andcommitted
Add docs for mjSpec serialization.
PiperOrigin-RevId: 752230683 Change-Id: Id237ccc1b265e99bf15892f8fd208ba38f4c6ded
1 parent d3bc054 commit fb30e0e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/python.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,12 @@ Parent:
628628
The parent body of a given element -- including bodies and frames -- can be accessed via the ``parent`` property.
629629
For example, the parent of a site can be accessed via ``site.parent``.
630630

631+
Serialization
632+
^^^^^^^^^^^^^
633+
The ``MjSpec`` object can be serialized with all of its assets using the function ``spec.to_zip(file)``, where ``file``
634+
can be either a path to a file or a file object. In order to load the spec from a zip file, use ``spec =
635+
MjSpec.from_zip(file)``, where ``file`` is a path to a zip file or a zip file object.
636+
631637
.. _PyMJCF:
632638

633639
Relationship to ``PyMJCF`` and ``bind``

0 commit comments

Comments
 (0)