Logo Search packages:      
Sourcecode: blender version File versions

World.py

# Blender.World module and the World PyType 

"""
The Blender.World submodule

B{New}: L{GetCurrent}, L{World.setCurrent}.

INTRODUCTION
============

The module world allows you to access all the data of a Blender World.

Example::
  import Blender
  w = Blender.Get('World') #assume there exists a world named "world"
  print w.getName()
  w.hor = [1,1,.2]
  print w.getHor()

Example::
  import Blender
  from Blender import *

  AllWorlds = Blender.World.Get()  # returns a list of created world obejcts
  AvailWorlds = len(AllWorlds)      #     returns the number of available world objects
  PropWorld = dir(AllWorlds[0])     # returns the properties of the class world
  NameWorld = AllWorlds[0].getName() # get name of the first world object

  MiType = AllWorlds[0].getMistype()      # get kind of mist from the first world object
  MiParam = AllWorlds[0].getMist()  # get the parameters intensity, start, end and height of the mist

  HorColor = AllWorlds[0].getHor()  # horizon color of the first world object
  HorColorR = HorColor[0]           # get the red channel (RGB) of the horizon color

  ZenColor = AllWorlds[0].getZen()  # zenit color of the first world object
  ZenColorB = ZenColor[2]           # get the blue channel (RGB) of the Zenit color

  blending = AllWorlds[0].getSkytype() # get the blending modes (real, blend, paper) of the first world object    
"""

def New (name):
  """
  Creates a new World.
  @type name: string
  @param name: World's name (optionnal).
  @rtype: Blender World
  @return: The created World. If the "name" parameter has not been provided, it will be automatically be set by blender.
  """

def Get (name):
  """
  Get an World from Blender.
  @type name: string
  @param name: The name of the world to retrieve.
  @rtype: Blender World or a list of Blender Worlds
  @return:
      - (name): The World corresponding to the name
      - ():     A list with all Worlds in the current scene.
  """


def GetCurrent ():
  """
  Get the active world of the scene.
  @rtype: Blender World or None
  """

00068 class World:
  """
  The World object
  ================
  This object gives access to generic data from all worlds in Blender.
  Its attributes depend upon its type.

  @cvar name: the name of the world.
  @cvar skytype: type of the sky. Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
  @cvar mode:
  @cvar mistype: type of mist : O : quadratic; 1 : linear; 2 : square
  @cvar hor:   the horizon color  of a world object.
  @cvar zen: the zenith color  of a world object.
  @cvar amb: the ambient color  of a world object.
  @cvar star: the star parameters  of a world object. See getStar for the semantics of these parameters. 
  @cvar mist: the mist parameters  of a world object. See getMist for the semantics of these parameters. 
  @type ipo: Blender Ipo
  @cvar ipo: The world type ipo linked to this world object.
  """
 
00088   def getRange():
    """
    Retrieves the range parameter of a world object.
    @rtype: float
    @return: the range
    """

00095   def setRange(range):
    """
    Sets the range parameter of a world object.
    @type range: float
    @param range: the new range parameter
    @rtype: PyNone
    @return: PyNone
    """

00104   def getName():
    """
    Retrieves the name of an world object
    @rtype: string
    @return:  the name of the world object.
    """

00111   def setName(name):
    """
    Sets the name of a world object.
    @type name: string
    @param name : the new name. 
    @rtype: PyNone
    @return:  PyNone
    """

00120   def getIpo():
    """
    Get the Ipo associated with this world object, if any.
    @rtype: Ipo
    @return: the wrapped ipo or None.
    """

00127   def setIpo(ipo):
    """
    Link an ipo to this world object.
    @type ipo: Blender Ipo
    @param ipo: a "camera data" ipo.
    """

00134   def clearIpo():
    """
    Unlink the ipo from this world object.
    @return: True if there was an ipo linked or False otherwise.
    """

00140   def 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.
    @rtype: int
    @return:  the skytype of the world object.
    """

00148   def setSkytype(skytype):
    """
    Sets the skytype of a world object.
    See getSkytype for the semantics of the parameter.
    @type skytype: int
    @param skytype : the new skytype. 
    @rtype: PyNone
    @return:  PyNone
    """

00158   def getMode():
    """
    Retrieves the mode of a world object.
    The mode is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
    @rtype: int
    @return:  the mode of the world object.
    """

00166   def setMode(mode):
    """
    Sets the mode of a world object.
    See getMode for the semantics of the parameter.
    @type mode: int
    @param mode : the new mode. 
    @rtype: PyNone
    @return:  PyNone
    """

00176   def getMistype():
    """
    Retrieves the mist type of a world object.
    The mist type is an integer 0 : quadratic;  1 : linear;  2 : square.
    @rtype: int
    @return:  the mistype of the world object.
    """

00184   def setMistype(mistype):
    """
    Sets the mist type of a world object.
    See getMistype for the semantics of the parameter.
    @type mistype: int
    @param mistype : the new mist type. 
    @rtype: PyNone
    @return:  PyNone
    """

00194   def getHor():
    """
    Retrieves the horizon color  of a world object.
    This color is a list of 3 floats.
    @rtype: list of three floats
    @return:  the horizon color of the world object.
    """

00202   def setHor(hor):
    """
    Sets the horizon color of a world object.
    @type hor:  list of three floats
    @param hor : the new hor. 
    @rtype: PyNone
    @return:  PyNone
    """

00211   def getZen():
    """
    Retrieves the zenith color  of a world object.
    This color is a list of 3 floats.
    @rtype: list of three floats
    @return:  the zenith color of the world object.
    """

00219   def setZen(zen):
    """
    Sets the zenith color of a world object.
    @type zen:  list of three floats
    @param zen : the new zenith color. 
    @rtype: PyNone
    @return:  PyNone
    """

00228   def getAmb():
    """
    Retrieves the ambient color  of a world object.
    This color is a list of 3 floats.
    @rtype: list of three floats
    @return:  the ambient color of the world object.
    """

00236   def setAmb(amb):
    """
    Sets the ambient color of a world object.
    @type amb:  list of three floats
    @param amb : the new ambient color. 
    @rtype: PyNone
    @return:  PyNone
    """

00245   def 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
    @rtype: list of nine floats
    @return:  the star parameters
    """

00260   def setStar(star):
    """
    Sets the star parameters  of a world object.
    See getStar for the semantics of the parameter.
    @type star:  list of 9 floats
    @param star : the new star parameters. 
    @rtype: PyNone
    @return:  PyNone
    """

00270   def 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
    @rtype: list of four floats
    @return:  the mist parameters
    """

00282   def setMist(mist):
    """
    Sets the mist parameters  of a world object.
    See getMist for the semantics of the parameter.
    @type mist:  list of 4 floats
    @param mist : the new mist parameters. 
    @rtype: PyNone
    @return:  PyNone
    """

00292   def getScriptLinks (event):
    """
    Get a list with this World's script links of type 'event'.
    @type event: string
    @param event: "FrameChanged" or "Redraw".
    @rtype: list
    @return: a list with Blender L{Text} names (the script links of the given
        'event' type) or None if there are no script links at all.
    """

00302   def clearScriptLinks ():
    """
    Delete all this World's script links!
    @rtype: bool
    @return: 0 if some internal problem occurred or 1 if successful.
    """

00309   def addScriptLink (text, event):
    """
    Add a new script link to this World.
    @type text: string
    @param text: the name of an existing Blender L{Text}.
    @type event: string
    @param event: "FrameChanged" or "Redraw".
    """
  
00318   def setCurrent ():
    """
    Make this world active in the current scene.
    @rtype: PyNone
    @return:  PyNone    
    """     

Generated by  Doxygen 1.6.0   Back to index