From b502ceef001e439331ca9bf847d96b0109997fe8 Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Wed, 4 Sep 2024 11:46:34 -0700 Subject: [PATCH] Add note that XML saving requires that the spec first be compiled. Fixes #1832 PiperOrigin-RevId: 671046666 Change-Id: If5885545d5316537147d293fbe854caa568558b2 --- doc/APIreference/functions.rst | 4 ++-- doc/APIreference/functions_override.rst | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/APIreference/functions.rst b/doc/APIreference/functions.rst index 31bd0d6d..d304bb2a 100644 --- a/doc/APIreference/functions.rst +++ b/doc/APIreference/functions.rst @@ -103,7 +103,7 @@ mj_saveXMLString .. mujoco-include:: mj_saveXMLString -Save spec to XML string, return 1 on success, 0 otherwise. +Save spec to XML string, return 1 on success, 0 otherwise. XML saving requires that the spec first be compiled. .. _mj_saveXML: @@ -112,7 +112,7 @@ mj_saveXML .. mujoco-include:: mj_saveXML -Save spec to XML file, return 1 on success, 0 otherwise. +Save spec to XML file, return 1 on success, 0 otherwise. XML saving requires that the spec first be compiled. .. _Mainsimulation: diff --git a/doc/APIreference/functions_override.rst b/doc/APIreference/functions_override.rst index 093a21ae..44318814 100644 --- a/doc/APIreference/functions_override.rst +++ b/doc/APIreference/functions_override.rst @@ -47,6 +47,14 @@ struct pointers while editing the model programmatically. :ref:`mj_recompile` returns 0 if compilation succeed. In the case of failure, the given :ref:`mjModel` and :ref:`mjData` instances will be deleted; as in :ref:`mj_compile`, the compilation error can be read with :ref:`mjs_getError`. +.. _mj_saveXMLString: + +Save spec to XML string, return 1 on success, 0 otherwise. XML saving requires that the spec first be compiled. + +.. _mj_saveXML: + +Save spec to XML file, return 1 on success, 0 otherwise. XML saving requires that the spec first be compiled. + .. _Mainsimulation: These are the main entry points to the simulator. Most users will only need to call :ref:`mj_step`, which computes