pysdic_blender.BlenderMaterialBSDF#
- class BlenderMaterialBSDF(base_color=None, metallic=None, roughness=None, IOR=None, alpha=None, normal=None, weight=None, subsurface_weight=None, subsurface_radius=None, subsurface_scale=None, subsurface_IOR=None, subsurface_anisotropy=None, specular_IOR_level=None, specular_tint=None, anisotropic=None, anisotropic_rotation=None, tangent=None, transmission_weight=None, coat_weight=None, coat_roughness=None, coat_IOR=None, coat_tint=None, coat_normal=None, sheen_weight=None, sheen_roughness=None, sheen_tint=None, emission_color=None, emission_strength=None, thin_film_thickness=None, thin_film_IOR=None)[source]#
Bases:
objectThe parameters of the Principled BSDF shader of Blender for the material of a mesh.
Each field is an input of the shader (see the Blender manual); a field left to None keeps the default value of Blender. The colors are RGBA tuples, the vectors (normals, tangent, radius) XYZ tuples.
With a texture (see
BlenderMesh), the reflectance of the texture is multiplied bybase_color(white by default).The object is immutable: use
dataclasses.replace()to change a field, e.g.dataclasses.replace(get_steel_material(), roughness=0.4).- Raises:
ValueError – If a field has a wrong number of values or non-finite values.
- Parameters:
metallic (float | None)
roughness (float | None)
IOR (float | None)
alpha (float | None)
weight (float | None)
subsurface_weight (float | None)
subsurface_scale (float | None)
subsurface_IOR (float | None)
subsurface_anisotropy (float | None)
specular_IOR_level (float | None)
anisotropic (float | None)
anisotropic_rotation (float | None)
transmission_weight (float | None)
coat_weight (float | None)
coat_roughness (float | None)
coat_IOR (float | None)
sheen_weight (float | None)
sheen_roughness (float | None)
emission_strength (float | None)
thin_film_thickness (float | None)
thin_film_IOR (float | None)
- classmethod from_dict(data)[source]#
Create a material from a dictionary of
to_dict()("type"and"description"are ignored, an unknown key raises aKeyError).- Parameters:
- Return type:
- classmethod from_json(path)[source]#
Create a material from a JSON file (see
from_dict()).- Parameters:
path (str)
- Return type:
- principled_inputs()[source]#
The values given to the inputs of the Principled BSDF node:
{input name: value}for the fields that are not None.