Use "/" as default prefix during attach if not specified.

The user can recover the old behavior by passing prefix="".

This enables to attach children with default and save a valid result to XML.

PiperOrigin-RevId: 825011185
Change-Id: Id20c2589da928bf92b77bdb01cfba73dfc1d2f52
This commit is contained in:
Alessio Quaglino
2025-10-28 06:39:44 -07:00
committed by Copybara-Service
parent 1bfa8b6fa6
commit 2bdea1a0aa
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -465,7 +465,7 @@ PYBIND11_MODULE(_specs, m) {
throw pybind11::value_error(
"Only one of frame or site can be specified.");
}
const char* p = prefix.has_value() ? prefix.value().c_str() : "";
const char* p = prefix.has_value() ? prefix.value().c_str() : "/";
const char* s = suffix.has_value() ? suffix.value().c_str() : "";
raw::MjsElement* attached_frame = nullptr;
if (frame.has_value()) {