Blender Materials: emit

emit
  • get/set the amount of light to emit

Type:
  • float number
Range: 
  • 0.0 to 2.0
  • 0.0 = no light emitted
  • 2.0 = maximum light emitted
Note:
  • Properties menu >> Material >> Shading >> Emit
Sample Code

################## get material light emitted

# 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 light emitted
mat_light = mat.emit

Sample Code

################## set material light emitted

# 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 light emitted
mat.light = 0.5