Setting the "Only Shadow" button of a lamp

Hi All,

I am trying to turn on the “OnlyShadow” button of a lamp I created with python.
I can not find a method or property to do this in the API.
Can this be done?
:slight_smile:

Play a little with lamp.mode:

To turn on “OnlyShadow”: lamp.mode |= Lamp.Modes[“OnlyShadow”] or lamp.setMode(“OnlyShadow”)
To turn off “OnlyShadow”: lamp.mode &= ~Lamp.Modes[“OnlyShadow”]

You can do the same with ‘Shadows’, ‘Halo’, ‘Layer’,‘Quad’,‘Negative’,‘Sphere’,‘Square’,‘NoDiffuse’,‘NoSpecular’,‘RayShadow’

Thanks,

I guess I did not dig far enough into the API.