The glb_materials.py module#
Summary#
Resolve GLTF material index from USD bindings or displayColor fallback. |
Description#
Material and texture conversion helpers for GLB export.
Module detail#
- glb_materials.get_material_index(prim: Any, display_colors: Any, color_interpolation: Any, gltf: Any, builder: ansys.tools.visualization_interface.backends.usd.web.glb_builder.GLBBuilder, texture_cache: dict[tuple[str, str, str], int], image_cache: dict[str, int], sampler_cache: dict[tuple[int, int], int]) int | None#
Resolve GLTF material index from USD bindings or displayColor fallback.
- Parameters:
- prim
Any The USD prim to get the material for.
- display_colors
Any The displayColor values to use for the material.
- color_interpolation
Any The interpolation method for the display colors.
- gltf
Any The glTF document to modify with new textures, images, and samplers as needed.
- builder
GLBBuilder The GLBBuilder instance managing the binary buffer.
- texture_cache
dict[tuple[str,str,str],int] Cache mapping (file_path, wrap_s, wrap_t) to glTF texture indices.
- image_cache
dict[str,int] Cache mapping file paths to glTF image indices.
- sampler_cache
dict[tuple[int,int],int] Cache mapping (wrap_s, wrap_t) to glTF sampler indices.
- prim
- Returns: