Add support in mjModel for tagging textures with different roles, and use the slot index of a texture to designate its role.

PiperOrigin-RevId: 654030065
Change-Id: I34a5b132a7f91a6bb8f260500c1b9c128a03b596
This commit is contained in:
Tom Erez
2024-07-19 09:28:34 -07:00
committed by Copybara-Service
parent 8a8a44a4db
commit 796173170c
14 changed files with 99 additions and 27 deletions
+1 -1
View File
@@ -168,7 +168,7 @@
X( float, light_, specular, nlight, 3 )
#define MJMODEL_MATERIAL \
X( int, mat_, texid, nmat, mjNTEXMAT ) \
X( int, mat_, texid, nmat, mjNTEXROLE ) \
X( mjtByte, mat_, texuniform, nmat, 1 ) \
X( float, mat_, texrepeat, nmat, 2 ) \
X( float, mat_, emission, nmat, 1 ) \
+3 -1
View File
@@ -252,7 +252,9 @@ class USDExporter:
assert geom_name not in self.geom_names
texture_file = (
self.texture_files[self.model.mat_texid[geom.matid][0]]
self.texture_files[
self.model.mat_texid[geom.matid][mujoco.mjTEXROLE_RGB]
]
if geom.matid != -1
else None
)