Blender Materials: specularIntensity

specularIntensity
  • get/set the strength (intensity) of the specular reflection

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

################## get the intensity of the specular 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 specular reflection intensity
mat_spec = mat.specularIntensity

Sample Code

################## set the intensity of the specular 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 specular reflection intensity
mat.specularIntensity = 0.5