| 88 | |
| 89 | |
| 90 | def _has_texture(geom: trimesh.Trimesh) -> bool: |
| 91 | if not isinstance(geom.visual, trimesh.visual.TextureVisuals): |
| 92 | return False |
| 93 | mat = geom.visual.material |
| 94 | if mat is None: |
| 95 | return False |
| 96 | # Simple material (SimpleMaterial / Material) |
| 97 | if getattr(mat, "image", None) is not None: |
| 98 | return True |
| 99 | # PBR material (from Trellis2 SLaT texturing and GLB imports) |
| 100 | if getattr(mat, "baseColorTexture", None) is not None: |
| 101 | return True |
| 102 | return False |
| 103 | |
| 104 | |
| 105 | def _get_texture_image(geom: trimesh.Trimesh): |