Material(ID)

base classes — bpy_struct, ID

class bpy.types.Material.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

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

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

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 event (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

Limit transparency to a single layer (avoids transparency sorting problems)

Type

boolean, default False

specular_color

Specular color of the material

Type

float array 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

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)

use_backface_culling

Use back face culling to hide the back side of faces

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 raytraced screen space refractions

Type

boolean, default False

use_sss_translucency

Add translucency effect to subsurface

Type

boolean, default False

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

  • bpy_struct.id_data

  • ID.name

  • ID.name_full

  • ID.is_evaluated

  • ID.original

  • ID.users

  • ID.use_fake_user

  • ID.is_embedded_data

  • ID.tag

  • ID.is_library_indirect

  • ID.library

  • ID.override_library

  • ID.preview

Inherited Functions

  • bpy_struct.as_pointer

  • bpy_struct.driver_add

  • bpy_struct.driver_remove

  • bpy_struct.get

  • bpy_struct.is_property_hidden

  • bpy_struct.is_property_overridable_library

  • bpy_struct.is_property_readonly

  • bpy_struct.is_property_set

  • bpy_struct.items

  • bpy_struct.keyframe_delete

  • bpy_struct.keyframe_insert

  • bpy_struct.keys

  • bpy_struct.path_from_id

  • bpy_struct.path_resolve

  • bpy_struct.pop

  • bpy_struct.property_overridable_library_set

  • bpy_struct.property_unset

  • bpy_struct.type_recast

  • bpy_struct.values

  • ID.evaluated_get

  • ID.copy

  • ID.override_create

  • ID.user_clear

  • ID.user_remap

  • ID.make_local

  • ID.user_of_id

  • ID.animation_data_create

  • ID.animation_data_clear

  • ID.update_tag

  • ID.bl_rna_get_subclass

  • ID.bl_rna_get_subclass_py

References

  • bpy.context.material

  • ArrayGpencilModifier.material

  • BlendData.materials

  • BlendDataMaterials.create_gpencil_data

  • BlendDataMaterials.new

  • BlendDataMaterials.remove

  • BlendDataMaterials.remove_gpencil_data

  • BrushGpencilSettings.material

  • ColorGpencilModifier.material

  • Curve.materials

  • GreasePencil.materials

  • Hair.materials

  • HookGpencilModifier.material

  • IDMaterials.append

  • IDMaterials.pop

  • LatticeGpencilModifier.material

  • MaterialSlot.material

  • Mesh.materials

  • MetaBall.materials

  • MirrorGpencilModifier.material

  • MultiplyGpencilModifier.material

  • NoiseGpencilModifier.material

  • Object.active_material

  • OffsetGpencilModifier.material

  • OpacityGpencilModifier.material

  • PointCloud.materials

  • SimplifyGpencilModifier.material

  • SmoothGpencilModifier.material

  • SubdivGpencilModifier.material

  • TextureGpencilModifier.material

  • ThickGpencilModifier.material

  • TintGpencilModifier.material

  • ViewLayer.material_override

  • Volume.materials