Module World :: Class World

Class World

source code

The World object

This object gives access to generic data from all worlds in Blender. Its attributes depend upon its type.

Instance Methods
float
getRange()
Retrieves the range parameter of a world object.
source code
None
setRange(range)
Sets the range parameter of a world object.
source code
string
getName()
Retrieves the name of a world object
source code
None
setName(name)
Sets the name of a world object.
source code
Ipo
getIpo()
Get the Ipo associated with this world object, if any.
source code
 
setIpo(ipo)
Link an ipo to this world object.
source code
 
clearIpo()
Unlink the ipo from this world object.
source code
int
getSkytype()
Retrieves the skytype of a world object.
source code
None
setSkytype(skytype)
Sets the skytype of a world object.
source code
int
getMode()
Retrieves the mode of a world object.
source code
None
setMode(mode)
Sets the mode of a world object.
source code
int
getMistype()
Retrieves the mist type of a world object.
source code
None
setMistype(mistype)
Sets the mist type of a world object.
source code
list of three floats
getHor()
Retrieves the horizon color of a world object.
source code
None
setHor(hor)
Sets the horizon color of a world object.
source code
list of three floats
getZen()
Retrieves the zenith color of a world object.
source code
None
setZen(zen)
Sets the zenith color of a world object.
source code
list of three floats
getAmb()
Retrieves the ambient color of a world object.
source code
None
setAmb(amb)
Sets the ambient color of a world object.
source code
list of nine floats
getStar()
Retrieves the star parameters of a world object.
source code
None
setStar(star)
Sets the star parameters of a world object.
source code
list of four floats
getMist()
Retrieves the mist parameters of a world object.
source code
None
setMist(mist)
Sets the mist parameters of a world object.
source code
list
getScriptLinks(event)
Get a list with this World's script links of type 'event'.
source code
 
clearScriptLinks(links=None)
Delete script links from this World :).
source code
 
addScriptLink(text, event)
Add a new script link to this World.
source code
None
setCurrent()
Make this world active in the current scene.
source code
 
insertIpoKey(keytype)
Inserts keytype values in world ipo at curframe.
source code
World
__copy__()
Make a copy of this world
source code
Instance Variables
  amb
the ambient color of a world object.
bool fakeUser
When set to True, this datablock wont be removed, even if nothing is using it.
  hor
the horizon color of a world object.
Blender Ipo ipo
The world type ipo linked to this world object.
string or None lib
path to the blend file this datablock is stored in (readonly).
  mist
the mist parameters of a world object.
  mistype
type of mist : O : quadratic; 1 : linear; 2 : square
  mode
string name
unique name within each blend file.
IDGroup properties
Returns an IDGroup reference to this datablocks's ID Properties.
  skytype
type of the sky.
  star
the star parameters of a world object.
bool tag
A temporary tag that to flag data as being used within a loop.
int users
The number of users this datablock has.
  zen
the zenith color of a world object.
Method Details

getRange()

source code 
Retrieves the range parameter of a world object.
Returns: float
the range

setRange(range)

source code 
Sets the range parameter of a world object.
Parameters:
  • range (float) - the new range parameter
Returns: None
None

getName()

source code 
Retrieves the name of a world object
Returns: string
the name of the world object.

setName(name)

source code 
Sets the name of a world object.
Parameters:
  • name (string) - the new name.
Returns: None
None

getIpo()

source code 
Get the Ipo associated with this world object, if any.
Returns: Ipo
the wrapped ipo or None.

setIpo(ipo)

source code 
Link an ipo to this world object.
Parameters:
  • ipo (Blender Ipo) - a "camera data" ipo.

clearIpo()

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

getSkytype()

source code 
Retrieves the skytype of a world object. The skytype is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
Returns: int
the skytype of the world object.

setSkytype(skytype)

source code 
Sets the skytype of a world object. See getSkytype for the semantics of the parameter.
Parameters:
  • skytype (int) - the new skytype.
Returns: None
None

getMode()

source code 
Retrieves the mode of a world object. The mode is a combination of 5 bits:
  • Bit 0 : mist simulation
  • Bit 1 : starfield simulation
  • Bit 2,3 : reserved
  • Bit 4 : ambient occlusion
Returns: int
the mode of the world object.

setMode(mode)

source code 
Sets the mode of a world object. See getMode for the semantics of the parameter.
Parameters:
  • mode (int) - the new mode.
Returns: None
None

getMistype()

source code 
Retrieves the mist type of a world object. The mist type is an integer 0 : quadratic; 1 : linear; 2 : square.
Returns: int
the mistype of the world object.

setMistype(mistype)

source code 
Sets the mist type of a world object. See getMistype for the semantics of the parameter.
Parameters:
  • mistype (int) - the new mist type.
Returns: None
None

getHor()

source code 
Retrieves the horizon color of a world object. This color is a list of 3 floats.
Returns: list of three floats
the horizon color of the world object.

setHor(hor)

source code 
Sets the horizon color of a world object.
Parameters:
  • hor (list of three floats) - the new hor.
Returns: None
None

getZen()

source code 
Retrieves the zenith color of a world object. This color is a list of 3 floats.
Returns: list of three floats
the zenith color of the world object.

setZen(zen)

source code 
Sets the zenith color of a world object.
Parameters:
  • zen (list of three floats) - the new zenith color.
Returns: None
None

getAmb()

source code 
Retrieves the ambient color of a world object. This color is a list of 3 floats.
Returns: list of three floats
the ambient color of the world object.

setAmb(amb)

source code 
Sets the ambient color of a world object.
Parameters:
  • amb (list of three floats) - the new ambient color.
Returns: None
None

getStar()

source code 
Retrieves the star parameters of a world object. It is a list of nine floats : red component of the color green component of the color blue component of the color size of the stars minimal distance between the stars average distance between the stars variations of the stars color
Returns: list of nine floats
the star parameters

setStar(star)

source code 
Sets the star parameters of a world object. See getStar for the semantics of the parameter.
Parameters:
  • star (list of 9 floats) - the new star parameters.
Returns: None
None

getMist()

source code 
Retrieves the mist parameters of a world object. It is a list of four floats : intensity of the mist start of the mist end of the mist height of the mist
Returns: list of four floats
the mist parameters

setMist(mist)

source code 
Sets the mist parameters of a world object. See getMist for the semantics of the parameter.
Parameters:
  • mist (list of 4 floats) - the new mist parameters.
Returns: None
None

getScriptLinks(event)

source code 
Get a list with this World's script links of type 'event'.
Parameters:
  • event (string) - "FrameChanged", "Redraw", "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)

source code 
Delete script links from this World :). 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)

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

setCurrent()

source code 
Make this world active in the current scene.
Returns: None
None

insertIpoKey(keytype)

source code 
Inserts keytype values in world ipo at curframe. Uses module constants.
Parameters:
  • keytype (Integer) - -ZENTIH -HORIZON -MIST -STARS -OFFSET -SIZE
Returns:
py_none

__copy__()

source code 
Make a copy of this world
Returns: World
a copy of this world

Instance Variable Details

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

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

mist

the mist parameters of a world object. See getMist for the semantics of these parameters.

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

skytype

type of the sky. Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.

star

the star parameters of a world object. See getStar for the semantics of these parameters.

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

users

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