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

Class World

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.
None
setRange(range)
Sets the range parameter of a world object.
string
getName()
Retrieves the name of a world object
None
setName(name)
Sets the name of a world object.
Ipo
getIpo()
Get the Ipo associated with this world object, if any.
 
setIpo(ipo)
Link an ipo to this world object.
 
clearIpo()
Unlink the ipo from this world object.
int
getSkytype()
Retrieves the skytype of a world object.
None
setSkytype(skytype)
Sets the skytype of a world object.
int
getMode()
Retrieves the mode of a world object.
None
setMode(mode)
Sets the mode of a world object.
int
getMistype()
Retrieves the mist type of a world object.
None
setMistype(mistype)
Sets the mist type of a world object.
list of three floats
getHor()
Retrieves the horizon color of a world object.
None
setHor(hor)
Sets the horizon color of a world object.
list of three floats
getZen()
Retrieves the zenith color of a world object.
None
setZen(zen)
Sets the zenith color of a world object.
list of three floats
getAmb()
Retrieves the ambient color of a world object.
None
setAmb(amb)
Sets the ambient color of a world object.
list of nine floats
getStar()
Retrieves the star parameters of a world object.
None
setStar(star)
Sets the star parameters of a world object.
list of four floats
getMist()
Retrieves the mist parameters of a world object.
None
setMist(mist)
Sets the mist parameters of a world object.
list
getScriptLinks(event)
Get a list with this World's script links of type 'event'.
 
clearScriptLinks(links=None)
Delete script links from this World :).
 
addScriptLink(text, event)
Add a new script link to this World.
None
setCurrent()
Make this world active in the current scene.
 
insertIpoKey(keytype)
Inserts keytype values in world ipo at curframe.
World
__copy__()
Make a copy of this world
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.
float gravity
World physics gravity setting between 0.0 and 25.0
  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.
a tuple of Blender MTex objects. textures
The World's texture list.
int users
The number of users this datablock has.
  zen
the zenith color of a world object.
Method Details

getRange()

 

Retrieves the range parameter of a world object.

Returns: float
the range

setRange(range)

 

Sets the range parameter of a world object.

Parameters:
  • range (float) - the new range parameter
Returns: None
None

getName()

 

Retrieves the name of a world object

Returns: string
the name of the world object.

setName(name)

 

Sets the name of a world object.

Parameters:
  • name (string) - the new name.
Returns: None
None

getIpo()

 

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

Returns: Ipo
the wrapped ipo or None.

setIpo(ipo)

 

Link an ipo to this world object.

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

clearIpo()

 

Unlink the ipo from this world object.

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

getSkytype()

 

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)

 

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()

 

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)

 

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()

 

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)

 

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()

 

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)

 

Sets the horizon color of a world object.

Parameters:
  • hor (list of three floats) - the new hor.
Returns: None
None

getZen()

 

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)

 

Sets the zenith color of a world object.

Parameters:
  • zen (list of three floats) - the new zenith color.
Returns: None
None

getAmb()

 

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)

 

Sets the ambient color of a world object.

Parameters:
  • amb (list of three floats) - the new ambient color.
Returns: None
None

getStar()

 

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)

 

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()

 

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)

 

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)

 

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)

 

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)

 

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()

 

Make this world active in the current scene.

Returns: None
None

insertIpoKey(keytype)

 

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

Parameters:
  • keytype (Integer) - -ZENTIH -HORIZON -MIST -STARS -OFFSET -SIZE
Returns:
py_none

__copy__()

 

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

textures

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

users

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