Module Lamp :: Class Lamp
[frames] | no frames]

Class Lamp

The Lamp Data object

This object gives access to Lamp-specific data in Blender.


Warning: Most member variables assume values in some [Min, Max] interval. When trying to set them, the given parameter will be clamped to lie in that range: if val < Min, then val = Min, if val > Max, then val = Max.

Instance Methods
string
getName()
Get the name of this Lamp Data object.
 
setName(name)
Set the name of this Lamp Data object.
int
getType()
Get this Lamp's type.
 
setType(type)
Set this Lamp's type.
int
getMode()
Get this Lamp's mode flags.
 
setMode(m=None, m2=None, m3=None, m4=None, m5=None, m6=None, m7=None, m8=None)
Set this Lamp's mode flags.
int
getSamples()
Get this lamp's samples value.
 
setSamples(samples)
Set the samples value.
int
getRaySamplesX()
Get this lamp's raytracing sample value on the X axis.
int
setRaySamplesX()
Set the lamp's raytracing sample value on the X axis, between 1 and 16.
int
getRaySamplesY()
Get this lamp's raytracing sample value on the Y axis.
int
setRaySamplesY()
Set the lamp's raytracing sample value on the Y axis, between 1 and 16.
int
getAreaSizeX()
Get this lamp's size on the X axis.
int
setAreaSizeX()
Set this lamp's size on the X axis.
int
getAreaSizeY()
Get this lamp's size on the Y axis.
int
setAreaSizeY()
Set this lamp's size on the Y axis.
int
getBufferSize()
Get this lamp's buffer size.
 
setBufferSize(bufsize)
Set the buffer size value.
int
getHaloStep()
Get this lamp's halo step value.
 
setHaloStep(hastep)
Set the halo step value.
float
getEnergy()
Get this lamp's energy intensity value.
 
setEnergy(energy)
Set the energy intensity value.
float
getDist()
Get this lamp's distance value.
 
setDist(distance)
Set the distance value.
float
getSpotSize()
Get this lamp's spot size value.
 
setSpotSize(spotsize)
Set the spot size value.
float
getSpotBlend()
Get this lamp's spot blend value.
 
setSpotBlend(spotblend)
Set the spot blend value.
float
getClipStart()
Get this lamp's clip start value.
 
setClipStart(clipstart)
Set the clip start value.
float
getClipEnd()
Get this lamp's clip end value.
 
setClipEnd(clipend)
Set the clip end value.
float
getBias()
Get this lamp's bias value.
 
setBias(bias)
Set the bias value.
float
getSoftness()
Get this lamp's softness value.
 
setSoftness(softness)
Set the softness value.
float
getHaloInt()
Get this lamp's halo intensity value.
 
setHaloInt(haloint)
Set the halo intensity value.
float
getQuad1()
Get this lamp's quad 1 value.
 
setQuad1(quad1)
Set the quad 1 value.
float
getQuad2()
Get this lamp's quad 2 value.
 
setQuad2(quad2)
Set the quad 2 value.
list
getScriptLinks(event)
Get a list with this Lamp's script links of type 'event'.
 
clearScriptLinks(links=None)
Delete script links from this Lamp.
 
addScriptLink(text, event)
Add a new script link to this Lamp.
Ipo
getIpo()
Get the Ipo associated with this Lamp object, if any.
 
setIpo(ipo)
Link an ipo to this Lamp object.
 
clearIpo()
Unlink the ipo from this Lamp object.
 
insertIpoKey(keytype)
Inserts keytype values in lamp ipo at curframe.
Lamp
__copy__()
Make a copy of this lamp
Instance Variables
float B
Lamp color blue component.
float G
Lamp color green component.
float R
Lamp color red component.
float areaSizeX
Lamp X size (X is used for the Y axis with square area lamps) Value is clamped to the range [0.01,100.0].
float areaSizeY
Lamp Y size (Y is only used for rectangle area lamps).
float bias
Lamp shadow map sampling bias.
int bufferSize
Lamp shadow buffer size.
int bufferType
Lamp shadowbuffer type.
float clipEnd
Lamp shadow map clip end.
float clipStart
Lamp shadow map clip start.
RGB tuple col
Lamp RGB color triplet.
float dist
Lamp clipping distance.
float energy
Lamp light intensity.
bool fakeUser
When set to True, this datablock wont be removed, even if nothing is using it.
int falloffType
Lamp falloff type.
float haloInt
Lamp spotlight halo intensity.
int haloStep
Lamp volumetric halo sampling frequency.
Blender Ipo ipo
Lamp Ipo.
string or None lib
path to the blend file this datablock is stored in (readonly).
int mode
Lamp mode bitfield.
string name
unique name within each blend file.
IDGroup properties
Returns an IDGroup reference to this datablocks's ID Properties.
float quad1
Quad lamp linear distance attenuation.
float quad2
Quad lamp quadratic distance attenuation.
int raySamplesX
Lamp raytracing X samples (X is used for the Y axis with square area lamps).
int raySamplesY
Lamp raytracing Y samples (Y is only used for rectangle area lamps).
int sampleBuffers
Lamp amount of shadow map sample buffers.
int samples
Lamp shadow map samples.
float softness
Lamp shadow sample area size.
float spotBlend
Lamp spotlight edge softness.
float spotSize
Lamp spotlight beam angle (in degrees).
bool tag
A temporary tag that to flag data as being used within a loop.
a tuple of Blender MTex objects. textures
The Lamp's texture list.
int type
Lamp type.
int users
The number of users this datablock has.
Method Details

setName(name)

 

Set the name of this Lamp Data object.

Parameters:
  • name (string) - The new name.

setType(type)

 

Set this Lamp's type.

Parameters:
  • type (string) - The Lamp type: 'Lamp', 'Sun', 'Spot', 'Hemi', 'Area', or 'Photon'

getMode()

 

Get this Lamp's mode flags.

Returns: int
OR'ed value. Use the Modes dictionary to check which flags are 'on'.

Example:

       flags = mylamp.getMode()
       if flags & mylamp.Modes['Shadows']:
               print "This lamp produces shadows"
       else:
               print "The 'Shadows' flag is off"

setMode(m=None, m2=None, m3=None, m4=None, m5=None, m6=None, m7=None, m8=None)

 

Set this Lamp's mode flags. Mode strings given are turned 'on'. Those not provided are turned 'off', so lamp.setMode() -- without arguments -- turns off all mode flags for Lamp lamp.

Parameters:
  • m (string) - A mode flag. From 1 to 8 can be set at the same time.

setSamples(samples)

 

Set the samples value.

Parameters:
  • samples (int) - The new samples value.

getRaySamplesX()

 

Get this lamp's raytracing sample value on the X axis. This value is only used for area lamps.

Returns: int

setRaySamplesX()

 

Set the lamp's raytracing sample value on the X axis, between 1 and 16. This value is only used for area lamps.

Returns: int

getRaySamplesY()

 

Get this lamp's raytracing sample value on the Y axis. This value is only used for rectangle area lamps.

Returns: int

setRaySamplesY()

 

Set the lamp's raytracing sample value on the Y axis, between 1 and 16. This value is only used for rectangle area lamps.

Returns: int

getAreaSizeX()

 

Get this lamp's size on the X axis. This value is only used for area lamps.

Returns: int

setAreaSizeX()

 

Set this lamp's size on the X axis. This value is only used for area lamps.

Returns: int

getAreaSizeY()

 

Get this lamp's size on the Y axis. This value is only used for rectangle area lamps.

Returns: int

setAreaSizeY()

 

Set this lamp's size on the Y axis. This value is only used for rectangle area lamps.

Returns: int

setBufferSize(bufsize)

 

Set the buffer size value.

Parameters:
  • bufsize (int) - The new buffer size value.

setHaloStep(hastep)

 

Set the halo step value.

Parameters:
  • hastep (int) - The new halo step value.

setEnergy(energy)

 

Set the energy intensity value.

Parameters:
  • energy (float) - The new energy value.

setDist(distance)

 

Set the distance value.

Parameters:
  • distance (float) - The new distance value.

setSpotSize(spotsize)

 

Set the spot size value.

Parameters:
  • spotsize (float) - The new spot size value.

setSpotBlend(spotblend)

 

Set the spot blend value.

Parameters:
  • spotblend (float) - The new spot blend value.

setClipStart(clipstart)

 

Set the clip start value.

Parameters:
  • clipstart (float) - The new clip start value.

setClipEnd(clipend)

 

Set the clip end value.

Parameters:
  • clipend (float) - The new clip end value.

setBias(bias)

 

Set the bias value.

Parameters:
  • bias (float) - The new bias value.

setSoftness(softness)

 

Set the softness value.

Parameters:
  • softness (float) - The new softness value.

setHaloInt(haloint)

 

Set the halo intensity value.

Parameters:
  • haloint (float) - The new halo intensity value.

getQuad1()

 

Get this lamp's quad 1 value.

Returns: float

Warning: this only applies to Lamps with the 'Quad' flag on.

setQuad1(quad1)

 

Set the quad 1 value.

Parameters:
  • quad1 (float)

Warning: this only applies to Lamps with the 'Quad' flag on.

getQuad2()

 

Get this lamp's quad 2 value.

Returns: float

Warning: this only applies to Lamps with the 'Quad' flag on.

setQuad2(quad2)

 

Set the quad 2 value.

Parameters:
  • quad2 (float) - The new quad 2 value.

Warning: this only applies to Lamps with the 'Quad' flag on.

getScriptLinks(event)

 

Get a list with this Lamp's script links of type 'event'.

Parameters:
  • event (string) - "FrameChanged", "Redraw" or "Render".
Returns: list
a list with Blender Text names (the script links of the given 'event' type) or None if there are no script links at all.

clearScriptLinks(links=None)

 

Delete script links from this Lamp. If no list is specified, all script links are deleted.

Parameters:
  • links (list of strings) - None (default) or a list of Blender Text names.

addScriptLink(text, event)

 

Add a new script link to this Lamp.

Parameters:
  • text (string) - the name of an existing Blender Text.
  • event (string) - "FrameChanged", "Redraw" or "Render".

getIpo()

 

Get the Ipo associated with this Lamp object, if any.

Returns: Ipo
the wrapped ipo or None.

setIpo(ipo)

 

Link an ipo to this Lamp object.

Parameters:
  • ipo (Blender Ipo) - a "lamp data" ipo.

clearIpo()

 

Unlink the ipo from this Lamp object.

Returns:
True if there was an ipo linked or False otherwise.

insertIpoKey(keytype)

 

Inserts keytype values in lamp ipo at curframe. Uses module constants.

Parameters:
  • keytype (Integer) - -RGB -ENERGY -SPOTSIZE -OFFSET -SIZE
Returns:
None

__copy__()

 

Make a copy of this lamp

Returns: Lamp
a copy of this lamp

Instance Variable Details

B

Lamp color blue component. Value is clamped to the range [0.0,1.0].
Type:
float

G

Lamp color green component. Value is clamped to the range [0.0,1.0].
Type:
float

R

Lamp color red component. Value is clamped to the range [0.0,1.0].
Type:
float

areaSizeY

Lamp Y size (Y is only used for rectangle area lamps). Value is clamped to the range [0.01,100.0].
Type:
float

bias

Lamp shadow map sampling bias. Value is clamped to the range [0.01,5.0].
Type:
float

bufferSize

Lamp shadow buffer size. Value is clamped to the range [512,5120].
Type:
int

bufferType

Lamp shadowbuffer type. See BufferTypes for values.
Type:
int

clipEnd

Lamp shadow map clip end. Value is clamped to the range [1.0,5000.0].
Type:
float

clipStart

Lamp shadow map clip start. Value is clamped to the range [0.1,1000.0].
Type:
float

col

Lamp RGB color triplet. Components are clamped to the range [0.0,1.0].
Type:
RGB tuple

dist

Lamp clipping distance. Value is clamped to the range [0.1,5000.0].
Type:
float

energy

Lamp light intensity. Value is clamped to the range [0.0,10.0].
Type:
float

fakeUser

When set to True, this datablock wont be removed, even if nothing is using it. All data has this disabled by default except for Actions.
Type:
bool

falloffType

Lamp falloff type. See Falloffs for values.
Type:
int

haloInt

Lamp spotlight halo intensity. Value is clamped to the range [0.0,5.0].
Type:
float

haloStep

Lamp volumetric halo sampling frequency. Value is clamped to the range [0,12].
Type:
int

ipo

Lamp Ipo. Contains the Ipo if one is assigned to the object, None otherwise. Setting to None clears the current Ipo..
Type:
Blender Ipo

lib

path to the blend file this datablock is stored in (readonly).

lib will be None unless you are using external blend files with (File, Append/Link)

Note: the path may be relative, to get the full path use Blender.sys.expandpath

Type:
string or None

mode

Lamp mode bitfield. See Modes for values.
Type:
int

name

unique name within each blend file.

The name is case sensitive and 21 characters maximum length.

Note: a blend file may have naming collisions when external library data is used, be sure to check the value of lib.

Note: Setting a value longer then 21 characters will be shortened

Type:
string

quad1

Quad lamp linear distance attenuation. Value is clamped to the range [0.0,1.0].
Type:
float

quad2

Quad lamp quadratic distance attenuation. Value is clamped to the range [0.0,1.0].
Type:
float

raySamplesX

Lamp raytracing X samples (X is used for the Y axis with square area lamps). Value is clamped to the range [1,16].
Type:
int

raySamplesY

Lamp raytracing Y samples (Y is only used for rectangle area lamps). Value is clamped to the range [1,16].
Type:
int

sampleBuffers

Lamp amount of shadow map sample buffers. Number of sample buffers for shadow buffer: 1, 4 or 9.
Type:
int

samples

Lamp shadow map samples. Value is clamped to the range [1,16].
Type:
int

softness

Lamp shadow sample area size. Value is clamped to the range [1.0,100.0].
Type:
float

spotBlend

Lamp spotlight edge softness. Value is clamped to the range [0.0,1.0].
Type:
float

spotSize

Lamp spotlight beam angle (in degrees). Value is clamped to the range [1.0,180.0].
Type:
float

tag

A temporary tag that to flag data as being used within a loop. always set all tags to True or False before using since blender uses this flag for its own internal operations.
Type:
bool

textures

The Lamp's texture list. Empty texture channels contains None.
Type:
a tuple of Blender MTex objects.

type

Lamp type. See Types for values.
Type:
int

users

The number of users this datablock has. (readonly) Zero user datablocks are de-allocated after reloading and saving.
Type:
int