12
15
w = Blender.Get('World') #assume there exists a world named "world"
24
AllWorlds = Blender.World.Get() # returns a list of created world obejcts
25
AvailWorlds = len(AllWorlds) # returns the number of available world objects
26
PropWorld = dir(AllWorlds[0]) # returns the properties of the class world
27
NameWorld = AllWorlds[0].getName() # get name of the first world object
29
MiType = AllWorlds[0].getMistype() # get kind of mist from the first world object
30
MiParam = AllWorlds[0].getMist() # get the parameters intensity, start, end and height of the mist
32
HorColor = AllWorlds[0].getHor() # horizon color of the first world object
33
HorColorR = HorColor[0] # get the red channel (RGB) of the horizon color
35
ZenColor = AllWorlds[0].getZen() # zenit color of the first world object
36
ZenColorB = ZenColor[2] # get the blue channel (RGB) of the Zenit color
38
blending = AllWorlds[0].getSkytype() # get the blending modes (real, blend, paper) of the first world object
22
45
@param name: World's name (optionnal).
23
46
@rtype: Blender World
24
@return: The created World. If the "name" paraeter has not been provided, it will be automatically be set by blender.
47
@return: The created World. If the "name" parameter has not been provided, it will be automatically be set by blender.
64
Get the active world of the scene.
65
@rtype: Blender World or None
43
72
This object gives access to generic data from all worlds in Blender.
44
73
Its attributes depend upon its type.
46
@cvar name: the name of the world.
47
@cvar skytype: type of the sky. Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
49
@cvar mistype: type of mist : O : quadratic; 1 : linear; 2 : square
50
@cvar hor: the horizon color of a world object.
51
@cvar zen: the zenith color of a world object.
52
@cvar amb: the ambient color of a world object.
53
@cvar star: the star parameters of a world object. See getStar for the semantics of these parameters.
54
@cvar mist: the mist parameters of a world object. See getMist for the semantics of these parameters.
75
@ivar name: the name of the world.
76
@ivar skytype: type of the sky. Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
78
@ivar mistype: type of mist : O : quadratic; 1 : linear; 2 : square
79
@ivar hor: the horizon color of a world object.
80
@ivar zen: the zenith color of a world object.
81
@ivar amb: the ambient color of a world object.
82
@ivar star: the star parameters of a world object. See getStar for the semantics of these parameters.
83
@ivar mist: the mist parameters of a world object. See getMist for the semantics of these parameters.
55
84
@type ipo: Blender Ipo
56
@cvar ipo: The world type ipo linked to this world object.
85
@ivar ipo: The world type ipo linked to this world object.
90
Retrieves the range parameter of a world object.
97
Sets the range parameter of a world object.
99
@param range: the new range parameter
61
Retreives the name of an world object
106
Retrieves the name of an world object
63
108
@return: the name of the world object.
97
Retreives the skytype of a world object.
142
Retrieves the skytype of a world object.
98
143
The skytype is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
100
145
@return: the skytype of the world object.
104
148
def setSkytype(skytype):
106
150
Sets the skytype of a world object.
116
Retreives the mode of a world object.
160
Retrieves the mode of a world object.
117
161
The mode is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
119
163
@return: the mode of the world object.
123
166
def setMode(mode):
125
168
Sets the mode of a world object.
133
176
def getMistype():
135
Retreives the mist type of a world object.
178
Retrieves the mist type of a world object.
136
179
The mist type is an integer 0 : quadratic; 1 : linear; 2 : square.
138
181
@return: the mistype of the world object.
142
184
def setMistype(mistype):
144
186
Sets the mist type of a world object.
154
Retreives the horizon color of a world object.
196
Retrieves the horizon color of a world object.
155
197
This color is a list of 3 floats.
156
198
@rtype: list of three floats
157
199
@return: the horizon color of the world object.
163
204
Sets the horizon color of a world object.
172
Retreives the zenith color of a world object.
213
Retrieves the zenith color of a world object.
173
214
This color is a list of 3 floats.
174
215
@rtype: list of three floats
175
216
@return: the zenith color of the world object.
181
221
Sets the zenith color of a world object.
190
Retreives the ambient color of a world object.
230
Retrieves the ambient color of a world object.
191
231
This color is a list of 3 floats.
192
232
@rtype: list of three floats
193
233
@return: the ambient color of the world object.
199
238
Sets the ambient color of a world object.
208
Retreives the star parameters of a world object.
247
Retrieves the star parameters of a world object.
209
248
It is a list of nine floats :
210
249
red component of the color
211
250
green component of the color
292
def getScriptLinks (event):
294
Get a list with this World's script links of type 'event'.
296
@param event: "FrameChanged", "Redraw", "Render".
298
@return: a list with Blender L{Text} names (the script links of the given
299
'event' type) or None if there are no script links at all.
302
def clearScriptLinks (links = None):
304
Delete script links from this World :). If no list is specified, all
305
script links are deleted.
306
@type links: list of strings
307
@param links: None (default) or a list of Blender L{Text} names.
310
def addScriptLink (text, event):
312
Add a new script link to this World.
314
@param text: the name of an existing Blender L{Text}.
316
@param event: "FrameChanged", "Redraw" or "Render".
321
Make this world active in the current scene.
326
def insertIpoKey(keytype):
328
Inserts keytype values in world ipo at curframe. Uses module constants.
329
@type keytype: Integer