Module Material
[frames | no frames]

Module Material

The Blender.Material submodule.

New: Material.clearScriptLinks accepts a parameter now.


This module provides access to Material objects in Blender.

 import Blender
 from Blender import Material
 mat = Material.New('newMat')          # create a new Material called 'newMat'
 print mat.rgbCol                      # print its rgb color triplet sequence
 mat.rgbCol = [0.8, 0.2, 0.2]          # change its color
 mat.setAlpha(0.2)                     # mat.alpha = 0.2 -- almost transparent
 mat.emit = 0.7                        # equivalent to mat.setEmit(0.8)
 mat.mode |= Material.Modes.ZTRANSP    # turn on Z-Buffer transparency
 mat.setName('RedBansheeSkin')         # change its name
 mat.setAdd(0.8)                       # make it glow
 mat.setMode('Halo')                   # turn 'Halo' "on" and all others "off"

Warning: Some Modes are only available when the 'Halo' mode is off and others only when it is on. But these two subsets of modes share the same numerical values in their Blender C #defines. So, for example, if 'Halo' is on, then 'NoMist' is actually interpreted as 'HaloShaded'. We marked all such possibilities in the Modes dict below: each halo-related mode that uses an already taken value is preceded by "-" and appear below the normal mode which also uses that value.

Material This object gives access to Materials in Blender.

Function Summary
Blender Material or a list of Blender Materials Get(name)
Get the Material object(s) from Blender.
Blender Material New(name)
Create a new Material object.

Variable Summary
readonly dictionary Modes: The available Material Modes.

Function Details


Get the Material object(s) from Blender.
name - The name of the Material.
It depends on the 'name' parameter:
  • (name): The Material object with the given name;
  • (): A list with all Material objects in the current scene.

           (type=Blender Material or a list of Blender Materials)


Create a new Material object.
name - The Material name.
The created Material object.
           (type=Blender Material)

Variable Details


The available Material Modes.
  • TRACEABLE - Make Material visible for shadow lamps.
  • SHADOW - Enable Material for shadows.
  • SHADELESS - Make Material insensitive to light or shadow.
  • WIRE - Render only the edges of faces.
  • VCOL_LIGHT - Add vertex colors as extra light.
  • VCOL_PAINT - Replace basic colors with vertex colors.
  • HALO - Render as a halo.
  • ZTRANSP - Z-buffer transparent faces.
  • ZINVERT - Render with inverted Z-buffer.
  • - HALORINGS - Render rings over the basic halo.
  • ENV - Do not render Material.
  • - HALOLINES - Render star shaped lines over the basic halo.
  • ONLYSHADOW - Let alpha be determined on the degree of shadow.
  • - HALOXALPHA - Use extreme alpha.
  • TEXFACE - UV-Editor assigned texture gives color and texture info for faces.
  • - HALOSTAR - Render halo as a star.
  • NOMIST - Set the Material insensitive to mist.
  • - HALOSHADED - Let halo receive light.
  • HALOTEX - Give halo a texture.
  • HALOPUNO - Use the vertex normal to specify the dimension of the halo.
  • HALOFLARE - Render halo as a lens flare.
  • RAYMIRROR - Enables raytracing for mirror reflection rendering.
  • RAYTRANSP - Enables raytracing for transparency rendering.
readonly dictionary

Generated by Epydoc 2.1 on Mon Jun 13 15:31:22 2005