Class MaterialsVariantsMeshPrimitiveExtension
Mesh primitive level KHR_materials_variants extension.
Inherited Members
Namespace: GLTFast.Schema
Assembly: glTFast.dll
Syntax
[Serializable]
public class MaterialsVariantsMeshPrimitiveExtension
Fields
mappings
List of material to variants mapping.
Declaration
public List<MaterialVariantsMapping> mappings
Field Value
Type | Description |
---|---|
List<MaterialVariantsMapping> |
See Also
Methods
TryGetMaterialIndex(int, out int)
Retrieves the index of the material that corresponds to a material variant. If there's no match for this variant index, it returns false. In this case the default material has to be applied.
Declaration
public bool TryGetMaterialIndex(int variantIndex, out int materialIndex)
Parameters
Type | Name | Description |
---|---|---|
int | variantIndex | glTF materials variant index. |
int | materialIndex | glTF material index. |
Returns
Type | Description |
---|---|
bool | True if there's a matching mapping with the provided variant index. False otherwise. |