Add mjmodel support for textures with different number of channels.
PiperOrigin-RevId: 653974959 Change-Id: Ia280e0bdb21027646249f104f21bedee792ba7e5
This commit is contained in:
committed by
Copybara-Service
parent
70ac76bb4b
commit
e92af73cbf
@@ -212,9 +212,10 @@ class USDExporter:
|
||||
for texture_id in tqdm.tqdm(range(self.model.ntex)):
|
||||
texture_height = self.model.tex_height[texture_id]
|
||||
texture_width = self.model.tex_width[texture_id]
|
||||
pixels = 3 * texture_height * texture_width
|
||||
texture_nchannel = self.model.tex_nchannel[texture_id]
|
||||
pixels = texture_nchannel * texture_height * texture_width
|
||||
img = im.fromarray(
|
||||
self.model.tex_rgb[data_adr : data_adr + pixels].reshape(
|
||||
self.model.tex_data[data_adr : data_adr + pixels].reshape(
|
||||
texture_height, texture_width, 3
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user