Make mjs_findElement find textures by file name.
This is done if the model is uncompiled and their name is empty. PiperOrigin-RevId: 772885774 Change-Id: I827d5b679637fa0571cfb0a69833ed688df16304
This commit is contained in:
committed by
Copybara-Service
parent
9e2c21a17d
commit
92bc486558
@@ -936,6 +936,8 @@ mjsElement* mjs_findElement(mjSpec* s, mjtObj type, const char* name) {
|
||||
case mjOBJ_LIGHT:
|
||||
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
|
||||
default:
|
||||
return model->FindObject(type, std::string(name)); // always available
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user