Add mjmHField to C API.

PiperOrigin-RevId: 606933108
Change-Id: I21c895ed3e137dab8f57e2d0bcfb558aae2b971a
This commit is contained in:
Alessio Quaglino
2024-02-14 04:11:29 -08:00
committed by Copybara-Service
parent 2ee8a4dabd
commit c9e7586499
8 changed files with 138 additions and 51 deletions
+5 -5
View File
@@ -1416,15 +1416,15 @@ void mjXWriter::Asset(XMLElement* root) {
// write attributes
WriteAttrTxt(elem, "name", phf->name);
WriteAttr(elem, "size", 4, phf->size);
if (!phf->file.empty()) {
WriteAttrTxt(elem, "content_type", phf->content_type);
WriteAttrTxt(elem, "file", phf->file);
if (!phf->file_.empty()) {
WriteAttrTxt(elem, "content_type", phf->content_type_);
WriteAttrTxt(elem, "file", phf->file_);
} else {
WriteAttrInt(elem, "nrow", phf->nrow);
WriteAttrInt(elem, "ncol", phf->ncol);
if (!phf->userdata().empty()) {
if (!phf->get_userdata().empty()) {
string text;
Vector2String(text, phf->userdata(), phf->ncol);
Vector2String(text, phf->get_userdata(), phf->ncol);
WriteAttrTxt(elem, "elevation", text);
}
}