Make mjs_findElement find meshes by file name.

PiperOrigin-RevId: 780150428
Change-Id: Ie500062fa8cca755683b66540e84ede588d7c331
This commit is contained in:
Alessio Quaglino
2025-07-07 09:50:49 -07:00
committed by Copybara-Service
parent 7a09145161
commit 1a4ddca6cf
4 changed files with 26 additions and 10 deletions
+3 -1
View File
@@ -910,7 +910,9 @@ mjsElement* mjs_findElement(mjSpec* s, mjtObj type, const char* name) {
case mjOBJ_FRAME:
return model->FindTree(model->GetWorld(), type, std::string(name)); // recursive search
case mjOBJ_TEXTURE:
return model->FindTexture(std::string(name)); // check filename too
return model->FindAsset(std::string(name), model->Textures()); // check filename too
case mjOBJ_MESH:
return model->FindAsset(std::string(name), model->Meshes()); // check filename too
default:
return model->FindObject(type, std::string(name)); // always available
}