From e89ff2cbb546705dcee7bb05a91f29971f64f714 Mon Sep 17 00:00:00 2001 From: Chenming Wu Date: Thu, 16 Nov 2023 21:17:41 +0800 Subject: [PATCH] fix error when specular-glossiness only has one channel --- trimesh/visual/gloss.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/trimesh/visual/gloss.py b/trimesh/visual/gloss.py index 8aa42bc74..8756c7f35 100644 --- a/trimesh/visual/gloss.py +++ b/trimesh/visual/gloss.py @@ -180,9 +180,7 @@ def get_specular_glossiness( or specularGlossinessTexture.shape[-1] ) == 1: # use the one channel as a multiplier for specular and glossiness - specularTexture = glossinessTexture = specularGlossinessTexture.reshape( - (-1, -1, 1) - ) + specularTexture = glossinessTexture = specularGlossinessTexture[..., np.newaxis] elif specularGlossinessTexture.shape[-1] == 3: # all channels are specular, glossiness is only a factor specularTexture = specularGlossinessTexture[..., :3]