
- get/set the diffuse color of the material
- float list: [ red, green, blue ]
red:
- range: 0.0 to 1.0
green:
- range: 0.0 to 1.0
blue:
- range: 0.0 to 1.0
- Properties menu >> Material >> Diffuse >> Color bar

################## get the diffuse reflection color
# 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 color
mat_diff_col = mat.diffuseColor
################## set the diffuse reflection color
# 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 color
mat.diffuseColor = [ 0.0, 0.0, 0.1 ]