From fba202109179be2cea6f7633e4ed54bd5a2d1990 Mon Sep 17 00:00:00 2001 From: Taylor Howell Date: Sat, 3 Jan 2026 10:48:05 -0800 Subject: [PATCH] MuJoCo Warp documentation: Modifying fields. PiperOrigin-RevId: 851709416 Change-Id: I48071a9dddd79b1e765f8ae170594d4687615877 --- doc/mjwarp/index.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/mjwarp/index.rst b/doc/mjwarp/index.rst index c04fe77e..e4cd3695 100644 --- a/doc/mjwarp/index.rst +++ b/doc/mjwarp/index.rst @@ -355,6 +355,17 @@ It is possible to override the field shape and set the field values after graph dof_damping = wp.array([[0.1], [0.2]], dtype=float) wp.copy(m.dof_damping, dof_damping) # m.dof = dof_damping will not update the captured graph +Modifying fields +---------------- + +The recommended workflow for modifying an :ref:`mjModel` field is to first modify the corresponding :ref:`mjSpec` and +then compile to create a new :ref:`mjModel` with the updated field. However, compilation currently requires a host call. + +Certain fields are safe to modify directly without compilation, enabling on-device updates. Please see +:ref:`mjModel changes` for details about specific fields. Additionally, +`GitHub issue 893 `__ tracks adding on-device updates for a +subset of fields. + .. admonition:: Heterogeneous worlds :class: note