Material(ID)
base classes — bpy_struct
, ID
- class bpy.types.Material(ID)
Material data-block to define the appearance of geometric objects for rendering
- alpha_threshold
A pixel is rendered only if its alpha value is above this threshold
- Type:
float in [0, 1], default 0.5
- blend_method
Blend Mode for Transparent Faces
OPAQUE
Opaque – Render surface without transparency.CLIP
Alpha Clip – Use the alpha threshold to clip the visibility (binary visibility).HASHED
Alpha Hashed – Use noise to dither the binary visibility (works well with multi-samples).BLEND
Alpha Blend – Render polygon transparent, depending on alpha channel of the texture.
- Type:
enum in [‘OPAQUE’, ‘CLIP’, ‘HASHED’, ‘BLEND’], default ‘OPAQUE’
- cycles
Cycles material settings
- Type:
CyclesMaterialSettings
, (readonly)
- diffuse_color
Diffuse color of the material
- Type:
float array of 4 items in [0, inf], default (0.8, 0.8, 0.8, 0.8)
- displacement_method
Method to use for the displacement
BUMP
Bump Only – Bump mapping to simulate the appearance of displacement.DISPLACEMENT
Displacement Only – Use true displacement of surface only, requires fine subdivision.BOTH
Displacement and Bump – Combination of true displacement and bump mapping for finer detail.
- Type:
enum in [‘BUMP’, ‘DISPLACEMENT’, ‘BOTH’], default ‘BUMP’
- grease_pencil
Grease pencil color settings for material
- Type:
MaterialGPencilStyle
, (readonly)
- is_grease_pencil
True if this material has grease pencil data
- Type:
boolean, default False, (readonly)
- lightprobe_volume_single_sided
Consider material single sided for light probe volume capture. Additionally helps rejecting probes inside the object to avoid light leaks
- Type:
boolean, default False
- line_color
Line color used for Freestyle line rendering
- Type:
float array of 4 items in [0, inf], default (0.0, 0.0, 0.0, 0.0)
- line_priority
The line color of a higher priority is used at material boundaries
- Type:
int in [0, 32767], default 0
- lineart
Line art settings for material
- Type:
MaterialLineArt
, (readonly)
- max_vertex_displacement
The max distance a vertex can be displaced. Displacements over this threshold may cause visibility issues
- Type:
float in [0, inf], default 0.0
- metallic
Amount of mirror reflection for raytrace
- Type:
float in [0, 1], default 0.0
- paint_active_slot
Index of active texture paint slot
- Type:
int in [0, 32767], default 0
- paint_clone_slot
Index of clone texture paint slot
- Type:
int in [0, 32767], default 0
- pass_index
Index number for the “Material Index” render pass
- Type:
int in [0, 32767], default 0
- preview_render_type
Type of preview render
FLAT
Flat – Flat XY plane.SPHERE
Sphere – Sphere.CUBE
Cube – Cube.HAIR
Hair – Hair strands.SHADERBALL
Shader Ball – Shader ball.CLOTH
Cloth – Cloth.FLUID
Fluid – Fluid.
- Type:
enum in [‘FLAT’, ‘SPHERE’, ‘CUBE’, ‘HAIR’, ‘SHADERBALL’, ‘CLOTH’, ‘FLUID’], default ‘SPHERE’
- refraction_depth
Approximate the thickness of the object to compute two refraction events (0 is disabled)
- Type:
float in [0, inf], default 0.0
- roughness
Roughness of the material
- Type:
float in [0, 1], default 0.4
- shadow_method
Shadow mapping method
NONE
None – Material will cast no shadow.OPAQUE
Opaque – Material will cast shadows without transparency.CLIP
Alpha Clip – Use the alpha threshold to clip the visibility (binary visibility).HASHED
Alpha Hashed – Use noise to dither the binary visibility and use filtering to reduce the noise.
- Type:
enum in [‘NONE’, ‘OPAQUE’, ‘CLIP’, ‘HASHED’], default ‘OPAQUE’
- show_transparent_back
Render multiple transparent layers (may introduce transparency sorting problems)
- Type:
boolean, default False
- specular_color
Specular color of the material
- Type:
mathutils.Color
of 3 items in [0, inf], default (1.0, 1.0, 1.0)
- specular_intensity
How intense (bright) the specular reflection is
- Type:
float in [0, 1], default 0.5
- surface_render_method
Controls the blending and the compatibility with certain features
DITHERED
Dithered – Allows for grayscale hashed transparency, and compatible with render passes and raytracing. Also known as deferred rendering.BLENDED
Blended – Allows for colored transparency, but incompatible with render passes and raytracing. Also known as forward rendering.
- Type:
enum in [‘DITHERED’, ‘BLENDED’], default ‘DITHERED’
- texture_paint_images
Texture images used for texture painting
- Type:
bpy_prop_collection
ofImage
, (readonly)
- texture_paint_slots
Texture slots defining the mapping and influence of textures
- Type:
bpy_prop_collection
ofTexPaintSlot
, (readonly)
- use_backface_culling
Use back face culling to hide the back side of faces
- Type:
boolean, default False
- use_backface_culling_shadow
Use back face culling when casting shadows
- Type:
boolean, default False
- use_nodes
Use shader nodes to render the material
- Type:
boolean, default False
- use_preview_world
Use the current world background to light the preview render
- Type:
boolean, default False
- use_screen_refraction
Use raytracing to determine refracted color instead of using only light probes. This prevents the surface from contributing to the lighting of surfaces not using this setting
- Type:
boolean, default False
- use_sss_translucency
Add translucency effect to subsurface
- Type:
boolean, default False
- use_transparent_shadow
Use transparent shadows for this material if it contains a Transparent BSDF, disabling will render faster but not give accurate shadows
- Type:
boolean, default True
- volume_intersection_method
Determines which inner part of the mesh will produce volumetric effect
FAST
Fast – Each face is considered as a medium interface. Gives correct results for manifold geometry that contains no inner parts.ACCURATE
Accurate – Faces are considered as medium interface only when they have different consecutive facing. Gives correct results as long as the max ray depth is not exceeded. Have significant memory overhead compared to the fast method.
- Type:
enum in [‘FAST’, ‘ACCURATE’], default ‘FAST’
- classmethod bl_rna_get_subclass(id, default=None)
- Parameters:
id (string) – The RNA type identifier.
- Returns:
The RNA type or default when not found.
- Return type:
bpy.types.Struct
subclass
- classmethod bl_rna_get_subclass_py(id, default=None)
- Parameters:
id (string) – The RNA type identifier.
- Returns:
The class or default when not found.
- Return type:
type
Inherited Properties
Inherited Functions
References