Class material

class o2sclpy.material(name: str, base_color=[1, 1, 1], txt: str = '', metal: float = 0.0, rough: float = 1.0, ds: bool = True, alpha_mode: str = 'opaque', alpha_cutoff: float = 0.5, emi_factor=[0.0, 0.0, 0.0], txt_w=0, txt_h=0)

A simple GLTF-like material class

Note that: the baseColorTexture is supposed to be stored in the sRGB colorspace and subject to hardware sRGB decoding, but the baseColorFactor has no hardware decoder and therefore is specified as linear values directly.

alpha_cutoff: float = 0.5

The alpha cutoff, default is 0.5.

alpha_mode: str = 'opaque'

The alpha mode, either ‘opaque’, ‘mask’, or ‘blend’.

base_color = [1.0, 1.0, 1.0]

The base color factor (either 3 or 4 floating point numbers)

These quantities are stored in pbrMetallicRoughness:baseColorFactor.

ds: bool = True

If true, the material is double-sided (default True)

emi_factor = [0.0, 0.0, 0.0]

The emissive factor

metal: float = 0.0

The metalness

This quantity is stored in pbrMetallicRoughness:metallicFactor.

name: str

The name of the material

rough: float = 1.0

The roughness (should default be 0 or 1?)

This quantity is stored in pbrMetallicRoughness:roughnessFactor.

txt: str = ''

The texture filename, including extension

txt_frac_h: float = 1.0

The fractional part of the texture height which is usable

txt_frac_w: float = 1.0

The fractional part of the texture width which is usable

txt_h: int = 0

The height of the texture, in pixels (always a power of two)

txt_w: int = 0

The width of the texture, in pixels (always a power of two)