2003-07-12 20:48:56 +00:00
|
|
|
# Blender.World module and the World PyType
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
The Blender.World submodule
|
|
|
|
|
|
2005-04-21 19:44:52 +00:00
|
|
|
B{New}: L{World.clearScriptLinks} accepts a parameter now.
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
|
2005-04-21 19:44:52 +00:00
|
|
|
World
|
|
|
|
|
=====
|
2003-07-12 20:48:56 +00:00
|
|
|
|
2003-07-22 00:27:03 +00:00
|
|
|
The module world allows you to access all the data of a Blender World.
|
2003-07-12 20:48:56 +00:00
|
|
|
|
2003-07-22 00:27:03 +00:00
|
|
|
Example::
|
2003-07-12 20:48:56 +00:00
|
|
|
import Blender
|
2003-07-22 00:27:03 +00:00
|
|
|
w = Blender.Get('World') #assume there exists a world named "world"
|
|
|
|
|
print w.getName()
|
|
|
|
|
w.hor = [1,1,.2]
|
2004-07-04 19:57:41 +00:00
|
|
|
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
|
2003-07-12 20:48:56 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def New (name):
|
|
|
|
|
"""
|
|
|
|
|
Creates a new World.
|
|
|
|
|
@type name: string
|
|
|
|
|
@param name: World's name (optionnal).
|
|
|
|
|
@rtype: Blender World
|
BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks);
- added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos);
- Blender.Image: added image.glFree() to free textures bound by the recently added
image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can
be used to load textures for scripts);
- Blender.Sound: removed for now at least a few get/set methods of vars that can't be
accessed via interface;
- renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for
now), same in Blender.Sound: renamed makeActive to setCurrent. Stephen Swaney
pointed this some weeks ago, we should stick to one naming convention.
- added documentation for Sound and Window.Theme modules and the other added
functions, made other small updates.
- Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix:
after reading a discussion on blender.org's Python forum where eeshlo mentioned the
pre 2.34 default was worldspace, I took a better look at Blender's relevant code,
confirmed, talked to Theeth about this and as he suggested am changing the default
back to 'worldspace'.
2004-10-20 05:51:24 +00:00
|
|
|
@return: The created World. If the "name" parameter has not been provided, it will be automatically be set by blender.
|
2003-07-12 20:48:56 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks);
- added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos);
- Blender.Image: added image.glFree() to free textures bound by the recently added
image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can
be used to load textures for scripts);
- Blender.Sound: removed for now at least a few get/set methods of vars that can't be
accessed via interface;
- renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for
now), same in Blender.Sound: renamed makeActive to setCurrent. Stephen Swaney
pointed this some weeks ago, we should stick to one naming convention.
- added documentation for Sound and Window.Theme modules and the other added
functions, made other small updates.
- Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix:
after reading a discussion on blender.org's Python forum where eeshlo mentioned the
pre 2.34 default was worldspace, I took a better look at Blender's relevant code,
confirmed, talked to Theeth about this and as he suggested am changing the default
back to 'worldspace'.
2004-10-20 05:51:24 +00:00
|
|
|
def GetCurrent ():
|
2004-06-22 11:38:58 +00:00
|
|
|
"""
|
|
|
|
|
Get the active world of the scene.
|
|
|
|
|
@rtype: Blender World or None
|
|
|
|
|
"""
|
|
|
|
|
|
2003-07-12 20:48:56 +00:00
|
|
|
class World:
|
|
|
|
|
"""
|
|
|
|
|
The World object
|
|
|
|
|
================
|
|
|
|
|
This object gives access to generic data from all worlds in Blender.
|
|
|
|
|
Its attributes depend upon its type.
|
2004-07-26 21:44:55 +00:00
|
|
|
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar name: the name of the world.
|
|
|
|
|
@ivar skytype: type of the sky. Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
|
|
|
|
|
@ivar mode:
|
|
|
|
|
@ivar mistype: type of mist : O : quadratic; 1 : linear; 2 : square
|
|
|
|
|
@ivar hor: the horizon color of a world object.
|
|
|
|
|
@ivar zen: the zenith color of a world object.
|
|
|
|
|
@ivar amb: the ambient color of a world object.
|
|
|
|
|
@ivar star: the star parameters of a world object. See getStar for the semantics of these parameters.
|
|
|
|
|
@ivar mist: the mist parameters of a world object. See getMist for the semantics of these parameters.
|
2003-10-28 00:29:37 +00:00
|
|
|
@type ipo: Blender Ipo
|
2005-06-15 06:22:26 +00:00
|
|
|
@ivar ipo: The world type ipo linked to this world object.
|
2003-07-12 20:48:56 +00:00
|
|
|
"""
|
2004-06-14 09:24:50 +00:00
|
|
|
|
|
|
|
|
def getRange():
|
|
|
|
|
"""
|
|
|
|
|
Retrieves the range parameter of a world object.
|
|
|
|
|
@rtype: float
|
|
|
|
|
@return: the range
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setRange(range):
|
|
|
|
|
"""
|
|
|
|
|
Sets the range parameter of a world object.
|
|
|
|
|
@type range: float
|
|
|
|
|
@param range: the new range parameter
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@return: PyNone
|
|
|
|
|
"""
|
2003-07-12 20:48:56 +00:00
|
|
|
|
|
|
|
|
def getName():
|
|
|
|
|
"""
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
Retrieves the name of an world object
|
2003-07-12 20:48:56 +00:00
|
|
|
@rtype: string
|
|
|
|
|
@return: the name of the world object.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setName(name):
|
|
|
|
|
"""
|
|
|
|
|
Sets the name of a world object.
|
|
|
|
|
@type name: string
|
|
|
|
|
@param name : the new name.
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@return: PyNone
|
|
|
|
|
"""
|
|
|
|
|
|
2003-10-28 00:29:37 +00:00
|
|
|
def getIpo():
|
|
|
|
|
"""
|
|
|
|
|
Get the Ipo associated with this world object, if any.
|
|
|
|
|
@rtype: Ipo
|
|
|
|
|
@return: the wrapped ipo or None.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def setIpo(ipo):
|
|
|
|
|
"""
|
|
|
|
|
Link an ipo to this world object.
|
|
|
|
|
@type ipo: Blender Ipo
|
|
|
|
|
@param ipo: a "camera data" ipo.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def clearIpo():
|
|
|
|
|
"""
|
|
|
|
|
Unlink the ipo from this world object.
|
|
|
|
|
@return: True if there was an ipo linked or False otherwise.
|
|
|
|
|
"""
|
|
|
|
|
|
2003-07-12 20:48:56 +00:00
|
|
|
def getSkytype():
|
|
|
|
|
"""
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
Retrieves the skytype of a world object.
|
2003-07-12 20:48:56 +00:00
|
|
|
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.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getMode():
|
|
|
|
|
"""
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
Retrieves the mode of a world object.
|
2003-07-12 20:48:56 +00:00
|
|
|
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.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getMistype():
|
|
|
|
|
"""
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
Retrieves the mist type of a world object.
|
2003-07-12 20:48:56 +00:00
|
|
|
The mist type is an integer 0 : quadratic; 1 : linear; 2 : square.
|
|
|
|
|
@rtype: int
|
|
|
|
|
@return: the mistype of the world object.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getHor():
|
|
|
|
|
"""
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
Retrieves the horizon color of a world object.
|
2003-07-12 20:48:56 +00:00
|
|
|
This color is a list of 3 floats.
|
|
|
|
|
@rtype: list of three floats
|
|
|
|
|
@return: the horizon color of the world object.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getZen():
|
|
|
|
|
"""
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
Retrieves the zenith color of a world object.
|
2003-07-12 20:48:56 +00:00
|
|
|
This color is a list of 3 floats.
|
|
|
|
|
@rtype: list of three floats
|
|
|
|
|
@return: the zenith color of the world object.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getAmb():
|
|
|
|
|
"""
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
Retrieves the ambient color of a world object.
|
2003-07-12 20:48:56 +00:00
|
|
|
This color is a list of 3 floats.
|
|
|
|
|
@rtype: list of three floats
|
|
|
|
|
@return: the ambient color of the world object.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getStar():
|
|
|
|
|
"""
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
Retrieves the star parameters of a world object.
|
2003-07-12 20:48:56 +00:00
|
|
|
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
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def getMist():
|
|
|
|
|
"""
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
Retrieves the mist parameters of a world object.
|
2003-07-12 20:48:56 +00:00
|
|
|
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
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
"""
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
|
|
|
|
|
def getScriptLinks (event):
|
|
|
|
|
"""
|
|
|
|
|
Get a list with this World's script links of type 'event'.
|
|
|
|
|
@type event: string
|
2005-05-22 07:22:34 +00:00
|
|
|
@param event: "FrameChanged", "Redraw", "Render".
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
@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.
|
|
|
|
|
"""
|
|
|
|
|
|
2005-04-21 19:44:52 +00:00
|
|
|
def clearScriptLinks (links = None):
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
"""
|
2005-04-21 19:44:52 +00:00
|
|
|
Delete script links from this World :). If no list is specified, all
|
|
|
|
|
script links are deleted.
|
|
|
|
|
@type links: list of strings
|
|
|
|
|
@param links: None (default) or a list of Blender L{Text} names.
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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
|
2005-05-22 07:22:34 +00:00
|
|
|
@param event: "FrameChanged", "Redraw" or "Render".
|
New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
2004-07-03 05:17:04 +00:00
|
|
|
"""
|
2004-09-20 16:22:32 +00:00
|
|
|
|
BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks);
- added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos);
- Blender.Image: added image.glFree() to free textures bound by the recently added
image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can
be used to load textures for scripts);
- Blender.Sound: removed for now at least a few get/set methods of vars that can't be
accessed via interface;
- renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for
now), same in Blender.Sound: renamed makeActive to setCurrent. Stephen Swaney
pointed this some weeks ago, we should stick to one naming convention.
- added documentation for Sound and Window.Theme modules and the other added
functions, made other small updates.
- Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix:
after reading a discussion on blender.org's Python forum where eeshlo mentioned the
pre 2.34 default was worldspace, I took a better look at Blender's relevant code,
confirmed, talked to Theeth about this and as he suggested am changing the default
back to 'worldspace'.
2004-10-20 05:51:24 +00:00
|
|
|
def setCurrent ():
|
2004-09-20 16:22:32 +00:00
|
|
|
"""
|
|
|
|
|
Make this world active in the current scene.
|
|
|
|
|
@rtype: PyNone
|
|
|
|
|
@return: PyNone
|
|
|
|
|
"""
|
2005-03-26 18:01:30 +00:00
|
|
|
|
|
|
|
|
def insertIpoKey(keytype):
|
|
|
|
|
"""
|
|
|
|
|
Inserts keytype values in world ipo at curframe. Uses module constants.
|
|
|
|
|
@type keytype: Integer
|
|
|
|
|
@param keytype:
|
|
|
|
|
-ZENTIH
|
|
|
|
|
-HORIZON
|
|
|
|
|
-MIST
|
|
|
|
|
-STARS
|
|
|
|
|
-OFFSET
|
|
|
|
|
-SIZE
|
|
|
|
|
@return: py_none
|
|
|
|
|
"""
|