Add docs for mjSpec serialization.

PiperOrigin-RevId: 752230683
Change-Id: Id237ccc1b265e99bf15892f8fd208ba38f4c6ded
This commit is contained in:
Alessio Quaglino
2025-04-28 02:57:48 -07:00
committed by Copybara-Service
parent d3bc0544d3
commit fb30e0e00c
+6
View File
@@ -628,6 +628,12 @@ Parent:
The parent body of a given element -- including bodies and frames -- can be accessed via the ``parent`` property.
For example, the parent of a site can be accessed via ``site.parent``.
Serialization
^^^^^^^^^^^^^
The ``MjSpec`` object can be serialized with all of its assets using the function ``spec.to_zip(file)``, where ``file``
can be either a path to a file or a file object. In order to load the spec from a zip file, use ``spec =
MjSpec.from_zip(file)``, where ``file`` is a path to a zip file or a zip file object.
.. _PyMJCF:
Relationship to ``PyMJCF`` and ``bind``