MCPcopy
hub / github.com/lightningpixel/modly / _has_texture

Function _has_texture

api/routers/optimize.py:90–102  ·  view source on GitHub ↗
(geom: trimesh.Trimesh)

Source from the content-addressed store, hash-verified

88
89
90def _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
105def _get_texture_image(geom: trimesh.Trimesh):

Callers 2

_decimateFunction · 0.85
_smoothFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected