Add assetdir compiler option.

PiperOrigin-RevId: 478117894
Change-Id: I4a93108e00558034aa02d22047da80adfa4232b2
This commit is contained in:
Kevin Zakka
2022-09-30 17:58:51 -07:00
committed by Copybara-Service
parent 8a8305d3ca
commit cce35e1816
6 changed files with 21 additions and 9 deletions
+8 -2
View File
@@ -79,10 +79,11 @@ static const int nMJCF = 183;
static const char* MJCF[nMJCF][mjXATTRNUM] = {
{"mujoco", "!", "1", "model"},
{"<"},
{"compiler", "*", "19", "autolimits", "boundmass", "boundinertia", "settotalmass",
{"compiler", "*", "20", "autolimits", "boundmass", "boundinertia", "settotalmass",
"balanceinertia", "strippath", "coordinate", "angle", "fitaabb", "eulerseq",
"meshdir", "texturedir", "discardvisual", "convexhull", "usethread",
"fusestatic", "inertiafromgeom", "inertiagrouprange", "exactmeshinertia"},
"fusestatic", "inertiafromgeom", "inertiagrouprange", "exactmeshinertia",
"assetdir"},
{"<"},
{"lengthrange", "?", "10", "mode", "useexisting", "uselimit",
"accel", "maxforce", "timeconst", "timestep",
@@ -853,6 +854,11 @@ void mjXReader::Compiler(XMLElement* section, mjCModel* mod) {
}
memcpy(mod->euler, text.c_str(), 3);
}
if (ReadAttrTxt(section, "assetdir", text)) {
mod->meshdir = text;
mod->texturedir = text;
}
// meshdir and texturedir take precedence over assetdir
ReadAttrTxt(section, "meshdir", mod->meshdir);
ReadAttrTxt(section, "texturedir", mod->texturedir);
if (MapValue(section, "discardvisual", &n, bool_map, 2)) {