Blender Materials: diffuseIntensity

diffuseIntensity
  • get/set the strength (intensity) of the diffuse reflection

Type:
  • float number
Range: 
  • 0.0 to 1.0
  • 0.0 = no diffuse reflection
  • 1.0 = maximum diffuse reflection
Note:
  • Properties menu >> Material >> Diffuse >> Intensity
Sample Code

################## get the intensity of the diffuse reflection

# import bge
import bge

# get the current controller
controller = bge.logic.getCurrentController()

# get object that owns this controller
obj = controller.owner
 
# There's only one mesh on my model
mesh = obj.meshes[0]

# And only one material on the mesh
mat = mesh.materials[0]

# get diffuse reflection intensity
mat_dif = mat.diffuseIntensity

Sample Code

################## set the intensity of the diffuse reflection

# import bge
import bge

# get the current controller
controller = bge.logic.getCurrentController()

# get object that owns this controller
obj = controller.owner
 
# There's only one mesh on my model
mesh = obj.meshes[0]

# And only one material on the mesh
mat = mesh.materials[0]

# set diffuse reflection intensity
mat.diffuseIntensity = 0.5