polyxios.SceneMaterial#

class polyxios.SceneMaterial(name: str = '', base_color: tuple[float, float, float, float]=(1.0, 1.0, 1.0, 1.0), metallic: float = 1.0, roughness: float = 1.0, emissive: tuple[float, float, float]=(0.0, 0.0, 0.0), alpha_mode: str = 'OPAQUE', alpha_cutoff: float = 0.5, double_sided: bool = False, base_color_texture: int | None = None, normal_texture: int | None = None, metallic_roughness_texture: int | None = None, occlusion_texture: int | None = None, emissive_texture: int | None = None, extras: dict[str, ~typing.Any]=<factory>)[source]#

PBR metallic-roughness material.

Parameters:
name

Material name from the source file.

base_color

RGBA base-color factor in linear space, each component in [0, 1].

metallic

Metallic factor in [0, 1].

roughness

Roughness factor in [0, 1].

emissive

RGB emissive factor in linear space.

alpha_mode

One of "OPAQUE", "MASK", or "BLEND".

alpha_cutoff

Alpha cutoff threshold used when alpha_mode is "MASK".

double_sided

Whether the material is rendered on both sides.

base_color_texture

Index into SceneData.textures, or None.

normal_texture

Index into SceneData.textures, or None.

metallic_roughness_texture

Index into SceneData.textures, or None.

occlusion_texture

Index into SceneData.textures, or None.

emissive_texture

Index into SceneData.textures, or None.

extras

Format-specific extra data preserved for round-tripping.

__init__(name: str = '', base_color: tuple[float, float, float, float]=(1.0, 1.0, 1.0, 1.0), metallic: float = 1.0, roughness: float = 1.0, emissive: tuple[float, float, float]=(0.0, 0.0, 0.0), alpha_mode: str = 'OPAQUE', alpha_cutoff: float = 0.5, double_sided: bool = False, base_color_texture: int | None = None, normal_texture: int | None = None, metallic_roughness_texture: int | None = None, occlusion_texture: int | None = None, emissive_texture: int | None = None, extras: dict[str, ~typing.Any]=<factory>) → None#

Methods

__init__(name, base_color, float, float, ...)

Attributes

name

base_color

metallic

roughness

emissive

alpha_mode

alpha_cutoff

double_sided

base_color_texture

normal_texture

metallic_roughness_texture

occlusion_texture

emissive_texture

extras