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

animation_data

Animation data for this data-block

Type:

AnimData, (readonly)

blend_method

Blend Mode for Transparent Faces (Deprecated: use ‘surface_render_method’)

  • 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’

diffuse_color

Diffuse color of the material

Type:

float array of 4 items in [0, inf], default (0.8, 0.8, 0.8, 1.0)

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)

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

node_tree

Node tree for node based materials

Type:

NodeTree, (readonly)

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) (Deprecated)

Type:

float in [0, inf], default 0.0

roughness

Roughness of the material

Type:

float in [0, 1], default 0.4

show_transparent_back

Render multiple transparent layers (may introduce transparency sorting problems) (Deprecated: use ‘use_tranparency_overlap’)

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 of Image, (readonly)

texture_paint_slots

Texture slots defining the mapping and influence of textures

Type:

bpy_prop_collection of TexPaintSlot, (readonly)

thickness_mode

Approximation used to model the light interactions inside the object

  • SPHERE Sphere – Approximate the object as a sphere whose diameter is equal to the thickness defined by the node tree.

  • SLAB Slab – Approximate the object as an infinite slab of thickness defined by the node tree.

Type:

enum in [‘SPHERE’, ‘SLAB’], default ‘SPHERE’

use_backface_culling

Use back face culling to hide the back side of faces

Type:

boolean, default False

use_backface_culling_lightprobe_volume

Consider material single sided for light probe volume capture. Additionally helps rejecting probes inside the object to avoid light leaks.

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_raytrace_refraction

Use raytracing to determine transmitted 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_screen_refraction

Use raytracing to determine transmitted color instead of using only light probes. This prevents the surface from contributing to the lighting of surfaces not using this setting. Deprecated: use ‘use_raytrace_refraction’.

Type:

boolean, default False

use_sss_translucency

Add translucency effect to subsurface (Deprecated)

Type:

boolean, default False

use_thickness_from_shadow

Use the shadow maps from shadow casting lights to refine the thickness defined by the material node tree

Type:

boolean, default False

use_transparency_overlap

Render multiple transparent layers (may introduce transparency sorting problems)

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 (str) – 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 (str) – The RNA type identifier.

Returns:

The class or default when not found.

Return type:

type

Inherited Properties

Inherited Functions

References