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
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.
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 getSamples()
Get this lamp's samples value.
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.
  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.
  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.
  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.

Class Variable Summary
  bias: The shadow map sampling bias in [0.01, 5.00].
  bufferSize: The size of the shadow buffer in [512, 5120].
  clipEnd: The shadow map clip end in [1.0, 5000.0].
  clipStart: The shadow map clip start in [0.1, 1000.0].
  col: The color of the light, with each rgb component in [0.0, 1.0].
  dist: The distance value in [0.1, 5000.0].
  energy: The intensity of the light in [0.0, 10.0].
  haloInt: The intensity of the spot halo in [0.0, 5.0].
  haloStep: Volumetric halo sampling frequency in [0, 12].
  mode: The mode flags: or'ed value of the flags in the Modes dict.
  Modes: The Modes dictionary.
  name: The Lamp Data name.
  quad1: Light intensity value 1 for a Quad lamp in [0.0, 1.0].
  quad2: Light intensity value 2 for a Quad lamp in [0.0, 1.0].
  samples: The number of shadow map samples in [1, 16].
  softness: The size of the shadow sample area in [1.0, 100.0].
  spotBlend: The softness of the spot edge in [0.0, 1.0].
  spotSize: The angle of the spot beam in degrees in [1.0, 180.0].
  type: The Lamp type (see the Types dict).
  Types: The Types dictionary.

Method Details

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

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.

getSamples()

Get this lamp's samples value.
Returns:
int

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

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)

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.

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' or 'Hemi'.
           (type=string)

Class Variable Details

bias

The shadow map sampling bias in [0.01, 5.00].

bufferSize

The size of the shadow buffer in [512, 5120].

clipEnd

The shadow map clip end in [1.0, 5000.0].

clipStart

The shadow map clip start in [0.1, 1000.0].

col

The color of the light, with each rgb component in [0.0, 1.0]. This is an rgb tuple whose values can be accessed in many ways:
  • as a tuple: lamp.col, lamp.col[0], same for 1 and 2.
  • as a dictionary: lamp.col['R'], same for 'G' and 'B'.
  • as an object: lamp.col.R, same for G and B.

dist

The distance value in [0.1, 5000.0].

energy

The intensity of the light in [0.0, 10.0].

haloInt

The intensity of the spot halo in [0.0, 5.0].

haloStep

Volumetric halo sampling frequency in [0, 12].

mode

The mode flags: or'ed value of the flags in the Modes dict.

Modes

The Modes dictionary.
  • 'Shadows'
  • 'Halo'
  • 'Layer'
  • 'Quad'
  • 'Negative'
  • 'OnlyShadow'
  • 'Sphere'
  • 'Square'

name

The Lamp Data name.

quad1

Light intensity value 1 for a Quad lamp in [0.0, 1.0].

quad2

Light intensity value 2 for a Quad lamp in [0.0, 1.0].

samples

The number of shadow map samples in [1, 16].

softness

The size of the shadow sample area in [1.0, 100.0].

spotBlend

The softness of the spot edge in [0.0, 1.0].

spotSize

The angle of the spot beam in degrees in [1.0, 180.0].

type

The Lamp type (see the Types dict).

Types

The Types dictionary.
  • 'Lamp': 0
  • 'Sun' : 1
  • 'Spot': 2
  • 'Hemi': 3

Generated by Epydoc 2.0 on Wed May 12 22:11:03 2004 http://epydoc.sf.net