in mujoco_py/modder.py [0:0]
def get_texture(self, name):
if name == 'skybox':
tex_id = -1
for i in range(self.model.ntex):
# TODO: Don't hardcode this
skybox_textype = 2
if self.model.tex_type[i] == skybox_textype:
tex_id = i
assert tex_id >= 0, "Model has no skybox"
else:
geom_id = self.model.geom_name2id(name)
mat_id = self.model.geom_matid[geom_id]
assert mat_id >= 0, "Geom has no assigned material"
tex_id = self.model.mat_texid[mat_id]
assert tex_id >= 0, "Material has no assigned texture"
texture = self.textures[tex_id]
return texture