Light: useShadow

useShadow
  • Returns if shadows have been enabled

Return Type:
  • boolean
Values:
  • True = Shadows are enabled
     
  • False = Shadows are not enabled
Note:
  • Shadows work with Spot and Sun lamps
     
  • To enable shadows in Blender 3D
    • Properties menu >> Object Data  >> Shadow checkbox
Sample Code

################## get if shadows are enabled
 
# import bge
import bge

# get current scene
scene = bge.logic.getCurrentScene()

# get a list of the lights in the scene
lightList = scene.lights

# get the spotlight named Spot_Light
light = lightList["Spot_Light"]

# get status of shadows
status = light.useShadow