From ff7ca4b1a258e2643794ebcec43fe674c3749425 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 4 Jan 2006 01:55:39 +0000 Subject: [PATCH] Gave an example of changing lamp modes in epydocs. - answers a q on elysuin. --- source/blender/python/api2_2x/doc/Lamp.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/blender/python/api2_2x/doc/Lamp.py b/source/blender/python/api2_2x/doc/Lamp.py index 52ec301f994..b1e0754c05c 100644 --- a/source/blender/python/api2_2x/doc/Lamp.py +++ b/source/blender/python/api2_2x/doc/Lamp.py @@ -38,6 +38,16 @@ Example:: - 'Square' - 'NoDiffuse' - 'RayShadow' + +Example:: + from Blender import Lamp, Object + # Change the mode of selected lamp objects. + for ob in Object.GetSelected(): # Loop through the current selection + if ob.getType() == "Lamp": # if this is a lamp. + lamp = ob.getData() # get the lamp data. + if lamp.type == Lamp.Types["Spot"]: # Lamp type is not a flag + lamp.mode &= ~Lamp.Modes["RayShadow"] # Disable RayShadow. + lamp.mode |= Lamp.Modes["Shadows"] # Enable Shadowbuffer shadows """ def New (type = 'Lamp', name = 'LampData'):