layer
layer
get/set the layer mask on which this light will illuminate objects.
Type: interger
1 = layer 1
2 = layer 2
3 = layer 2 and 1
4 = layer 3
5 = layer 3 and 1
6 = layer 3 and 2
7 = layer 3 and 2 and 1
8 = layer 4
etc.
16 = layer 5
etc.
32 = layer 6
etc.
Note:
A lamp can be on more than one layer.
If the light is on layer 1, layer 2
and layer 3
layer = light.layer will return 7
1 (for layer 1) + 2 (for layer 2) + 4 (for layer 3)
Sample Code
########################## get light layer mask
# get the current scene
scene = GameLogic.getCurrentScene()
# get a list of the lights in the scene
lightList = scene.lights
# get the light named Lamp
light = lightList["OBLamp"]
# get the layer(s) that the light illuminates
layers = light.layer
########################## set light layer mask
# get the current scene
scene = GameLogic.getCurrentScene()
# get a list of the lights in the scene
lightList = scene.lights
# get the light named Lamp
light = lightList["OBLamp"]
# set the light to illuminate layers to 1, 2 and 4
light.layer = 11
|