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.

Method Summary
Lamp __copy__()
Make a copy of this lamp
  addScriptLink(text, event)
Add a new script link to this Lamp.
  clearIpo()
Unlink the ipo from this Lamp object.
  clearScriptLinks(links)
Delete script links from this Lamp.
int getAreaSizeX()
Get this lamp's size on the X axis.
int getAreaSizeY()
Get this lamp's size on the Y axis.
float getBias()
Get this lamp's bias value.
int getBufferSize()
Get this lamp's buffer size.
float getClipEnd()
Get this lamp's clip end value.
float getClipStart()
Get this lamp's clip start value.
float getDist()
Get this lamp's distance value.
float getEnergy()
Get this lamp's energy intensity value.
float getHaloInt()
Get this lamp's halo intensity value.
int getHaloStep()
Get this lamp's halo step value.
Ipo getIpo()
Get the Ipo associated with this Lamp object, if any.
int getMode()
Get this Lamp's mode flags.
string getName()
Get the name of this Lamp Data object.
float getQuad1()
Get this lamp's quad 1 value.
float getQuad2()
Get this lamp's quad 2 value.
int getRaySamplesX()
Get this lamp's raytracing sample value on the X axis.
int getRaySamplesY()
Get this lamp's raytracing sample value on the Y axis.
int getSamples()
Get this lamp's samples value.
list getScriptLinks(event)
Get a list with this Lamp's script links of type 'event'.
float getSoftness()
Get this lamp's softness value.
float getSpotBlend()
Get this lamp's spot blend value.
float getSpotSize()
Get this lamp's spot size value.
int getType()
Get this Lamp's type.
  insertIpoKey(keytype)
Inserts keytype values in lamp ipo at curframe.
int setAreaSizeX()
Set this lamp's size on the X axis.
int setAreaSizeY()
Set this lamp's size on the Y axis.
  setBias(bias)
Set the bias value.
  setBufferSize(bufsize)
Set the buffer size value.
  setClipEnd(clipend)
Set the clip end value.
  setClipStart(clipstart)
Set the clip start value.
  setDist(distance)
Set the distance value.
  setEnergy(energy)
Set the energy intensity value.
  setHaloInt(haloint)
Set the halo intensity value.
  setHaloStep(hastep)
Set the halo step value.
  setIpo(ipo)
Link an ipo to this Lamp object.
  setMode(m, m2, m3, m4, m5, m6, m7, m8)
Set this Lamp's mode flags.
  setName(name)
Set the name of this Lamp Data object.
  setQuad1(quad1)
Set the quad 1 value.
  setQuad2(quad2)
Set the quad 2 value.
int setRaySamplesX()
Set the lamp's raytracing sample value on the X axis, between 1 and 16.
int setRaySamplesY()
Set the lamp's raytracing sample value on the Y axis, between 1 and 16.
  setSamples(samples)
Set the samples value.
  setSoftness(softness)
Set the softness value.
  setSpotBlend(spotblend)
Set the spot blend value.
  setSpotSize(spotsize)
Set the spot size value.
  setType(type)
Set this Lamp's type.

Instance Variable Summary
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 B: Lamp color blue component.
float bias: Lamp shadow map sampling bias.
int bufferSize: Lamp shadow buffer size.
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.
float G: Lamp color green component.
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.
float R: Lamp color red component.
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 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.
int type: Lamp type.
int users: The number of users this datablock has.

Method Details

__copy__()

Make a copy of this lamp
Returns:
a copy of this lamp
           (type=Lamp)

addScriptLink(text, event)

Add a new script link to this Lamp.
Parameters:
text - the name of an existing Blender Text.
           (type=string)
event - "FrameChanged", "Redraw" or "Render".
           (type=string)

clearIpo()

Unlink the ipo from this Lamp object.
Returns:
True if there was an ipo linked or False otherwise.

clearScriptLinks(links=None)

Delete script links from this Lamp. If no list is specified, all script links are deleted.
Parameters:
links - None (default) or a list of Blender Text names.
           (type=list of strings)

getAreaSizeX()

Get 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

getBias()

Get this lamp's bias value.
Returns:
float

getBufferSize()

Get this lamp's buffer size.
Returns:
int

getClipEnd()

Get this lamp's clip end value.
Returns:
float

getClipStart()

Get this lamp's clip start value.
Returns:
float

getDist()

Get this lamp's distance value.
Returns:
float

getEnergy()

Get this lamp's energy intensity value.
Returns:
float

getHaloInt()

Get this lamp's halo intensity value.
Returns:
float

getHaloStep()

Get this lamp's halo step value.
Returns:
int

getIpo()

Get the Ipo associated with this Lamp object, if any.
Returns:
the wrapped ipo or None.
           (type=Ipo)

getMode()

Get this Lamp's mode flags.
Returns:

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"

           (type=int)

getName()

Get the name of this Lamp Data object.
Returns:
string

getQuad1()

Get this lamp's quad 1 value.
Returns:
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.

getRaySamplesX()

Get this lamp's raytracing sample value on the X axis. 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

getSamples()

Get this lamp's samples value.
Returns:
int

getScriptLinks(event)

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

getSoftness()

Get this lamp's softness value.
Returns:
float

getSpotBlend()

Get this lamp's spot blend value.
Returns:
float

getSpotSize()

Get this lamp's spot size value.
Returns:
float

getType()

Get this Lamp's type.
Returns:
int

insertIpoKey(keytype)

Inserts keytype values in lamp ipo at curframe. Uses module constants.
Parameters:
keytype - -RGB -ENERGY -SPOTSIZE -OFFSET -SIZE
           (type=Integer)
Returns:
None

setAreaSizeX()

Set this lamp's size on the X axis. This value is only used for 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

setBias(bias)

Set the bias value.
Parameters:
bias - The new bias value.
           (type=float)

setBufferSize(bufsize)

Set the buffer size value.
Parameters:
bufsize - The new buffer size value.
           (type=int)

setClipEnd(clipend)

Set the clip end value.
Parameters:
clipend - The new clip end value.
           (type=float)

setClipStart(clipstart)

Set the clip start value.
Parameters:
clipstart - The new clip start value.
           (type=float)

setDist(distance)

Set the distance value.
Parameters:
distance - The new distance value.
           (type=float)

setEnergy(energy)

Set the energy intensity value.
Parameters:
energy - The new energy value.
           (type=float)

setHaloInt(haloint)

Set the halo intensity value.
Parameters:
haloint - The new halo intensity value.
           (type=float)

setHaloStep(hastep)

Set the halo step value.
Parameters:
hastep - The new halo step value.
           (type=int)

setIpo(ipo)

Link an ipo to this Lamp object.
Parameters:
ipo - a "lamp data" ipo.
           (type=Blender Ipo)

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 - A mode flag. From 1 to 8 can be set at the same time.
           (type=string)

setName(name)

Set the name of this Lamp Data object.
Parameters:
name - The new name.
           (type=string)

setQuad1(quad1)

Set the quad 1 value.
Parameters:
quad1
           (type=float)

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

setQuad2(quad2)

Set the quad 2 value.
Parameters:
quad2 - The new quad 2 value.
           (type=float)

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

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

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

setSamples(samples)

Set the samples value.
Parameters:
samples - The new samples value.
           (type=int)

setSoftness(softness)

Set the softness value.
Parameters:
softness - The new softness value.
           (type=float)

setSpotBlend(spotblend)

Set the spot blend value.
Parameters:
spotblend - The new spot blend value.
           (type=float)

setSpotSize(spotsize)

Set the spot size value.
Parameters:
spotsize - The new spot size value.
           (type=float)

setType(type)

Set this Lamp's type.
Parameters:
type - The Lamp type: 'Lamp', 'Sun', 'Spot', 'Hemi', 'Area', or 'Photon'
           (type=string)

Instance Variable Details

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].
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

B

Lamp color blue component. Value is clamped to the range [0.0,1.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

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

G

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

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

properties

Returns an IDGroup reference to this datablocks's ID Properties.
Type:
IDGroup

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

R

Lamp color red component. 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

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

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

Generated by Epydoc 2.1 on Thu May 10 20:32:00 2007 http://epydoc.sf.net