Require prefix for the attach tag.

For `mjs_attachFrame` and `mjs_attachBody`, require either a prefix or suffix.

It is tempting for users to not use a prefix (see #2162), but this causes issues. For example, it creates a duplicate "main" default class in the parent as a child of the already existing "main" default.

PiperOrigin-RevId: 688535755
Change-Id: I653181ca35943f1e4eb89c70fca8b5289818324e
This commit is contained in:
Alessio Quaglino
2024-10-22 07:07:33 -07:00
committed by Copybara-Service
parent 94e9912d28
commit bfa78614c8
5 changed files with 23 additions and 15 deletions
+5 -5
View File
@@ -3861,19 +3861,19 @@ all attachments will appear in the saved XML file.
.. _body-attach-model:
:at:`model`: :at-val:`string, optional`
:at:`model`: :at-val:`string, required`
The sub-model from which to attach a subtree.
.. _body-attach-body:
:at:`body`: :at-val:`string, optional`
:at:`body`: :at-val:`string, required`
Name of the body in the sub-model to attach here. The body and its subtree will be attached.
.. _body-attach-prefix:
:at:`prefix`: :at-val:`string, optional`
Prefix to prepend to names of elements in the sub-model. If empty, the names are unchanged. This attribute is
required to prevent name collisions with the parent or when attaching the same sub-tree multiple times.
:at:`prefix`: :at-val:`string, required`
Prefix to prepend to names of elements in the sub-model. This attribute is required to prevent name collisions with
the parent or when attaching the same sub-tree multiple times.
.. _body-frame: