11
11
The module world allows you to access all the data of a Blender World.
15
w = Blender.Get('World') #assume there exists a world named "world"
15
w = Blender.Get('World') #assume there exists a world named "world"
24
AllWorlds = Blender.World.Get() # returns a list of created world objects
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() # zenith color of the first world object
36
ZenColorB = ZenColor[2] # get the blue channel (RGB) of the Zenith color
38
blending = AllWorlds[0].getSkytype() # get the blending modes (real, blend, paper) of the first world object
24
AllWorlds = Blender.World.Get() # returns a list of created world objects
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() # zenith color of the first world object
36
ZenColorB = ZenColor[2] # get the blue channel (RGB) of the Zenith color
38
blending = AllWorlds[0].getSkytype() # get the blending modes (real, blend, paper) of the first world object
45
@param name: World's name (optional).
47
@return: The created World. If the "name" parameter has not been provided, it will be automatically be set by blender.
45
@param name: World's name (optional).
47
@return: The created World. If the "name" parameter has not been provided, it will be automatically be set by blender.
52
Get an World from Blender.
54
@param name: The name of the world to retrieve.
55
@rtype: Blender World or a list of Blender Worlds
57
- (name): The World corresponding to the name
58
- (): A list with all Worlds in the current scene.
52
Get an World from Blender.
54
@param name: The name of the world to retrieve.
55
@rtype: Blender World or a list of Blender Worlds
57
- (name): The World corresponding to the name
58
- (): A list with all Worlds in the current scene.
64
Get the active world of the scene.
65
@rtype: Blender World or None
64
Get the active world of the scene.
65
@rtype: Blender World or None
72
This object gives access to generic data from all worlds in Blender.
73
Its attributes depend upon its type.
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.
84
@type ipo: Blender Ipo
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
106
Retrieves the name of a world object
108
@return: the name of the world object.
113
Sets the name of a world object.
115
@param name : the new name.
122
Get the Ipo associated with this world object, if any.
124
@return: the wrapped ipo or None.
129
Link an ipo to this world object.
130
@type ipo: Blender Ipo
131
@param ipo: a "camera data" ipo.
136
Unlink the ipo from this world object.
137
@return: True if there was an ipo linked or False otherwise.
142
Retrieves the skytype of a world object.
143
The skytype is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
145
@return: the skytype of the world object.
148
def setSkytype(skytype):
150
Sets the skytype of a world object.
151
See getSkytype for the semantics of the parameter.
153
@param skytype : the new skytype.
160
Retrieves the mode of a world object.
161
The mode is a combination of 5 bits:
162
- Bit 0 : mist simulation
163
- Bit 1 : starfield simulation
165
- Bit 4 : ambient occlusion
167
@return: the mode of the world object.
172
Sets the mode of a world object.
173
See getMode for the semantics of the parameter.
175
@param mode : the new mode.
182
Retrieves the mist type of a world object.
183
The mist type is an integer 0 : quadratic; 1 : linear; 2 : square.
185
@return: the mistype of the world object.
188
def setMistype(mistype):
190
Sets the mist type of a world object.
191
See getMistype for the semantics of the parameter.
193
@param mistype : the new mist type.
200
Retrieves the horizon color of a world object.
201
This color is a list of 3 floats.
202
@rtype: list of three floats
203
@return: the horizon color of the world object.
208
Sets the horizon color of a world object.
209
@type hor: list of three floats
210
@param hor : the new hor.
217
Retrieves the zenith color of a world object.
218
This color is a list of 3 floats.
219
@rtype: list of three floats
220
@return: the zenith color of the world object.
225
Sets the zenith color of a world object.
226
@type zen: list of three floats
227
@param zen : the new zenith color.
234
Retrieves the ambient color of a world object.
235
This color is a list of 3 floats.
236
@rtype: list of three floats
237
@return: the ambient color of the world object.
242
Sets the ambient color of a world object.
243
@type amb: list of three floats
244
@param amb : the new ambient color.
251
Retrieves the star parameters of a world object.
252
It is a list of nine floats :
253
red component of the color
254
green component of the color
255
blue component of the color
257
minimal distance between the stars
258
average distance between the stars
259
variations of the stars color
260
@rtype: list of nine floats
261
@return: the star parameters
266
Sets the star parameters of a world object.
267
See getStar for the semantics of the parameter.
268
@type star: list of 9 floats
269
@param star : the new star parameters.
276
Retrieves the mist parameters of a world object.
277
It is a list of four floats :
278
intensity of the mist
282
@rtype: list of four floats
283
@return: the mist parameters
288
Sets the mist parameters of a world object.
289
See getMist for the semantics of the parameter.
290
@type mist: list of 4 floats
291
@param mist : the new mist parameters.
296
def getScriptLinks (event):
298
Get a list with this World's script links of type 'event'.
300
@param event: "FrameChanged", "Redraw", "Render".
302
@return: a list with Blender L{Text} names (the script links of the given
303
'event' type) or None if there are no script links at all.
306
def clearScriptLinks (links = None):
308
Delete script links from this World :). If no list is specified, all
309
script links are deleted.
310
@type links: list of strings
311
@param links: None (default) or a list of Blender L{Text} names.
314
def addScriptLink (text, event):
316
Add a new script link to this World.
318
@param text: the name of an existing Blender L{Text}.
320
@param event: "FrameChanged", "Redraw" or "Render".
325
Make this world active in the current scene.
330
def insertIpoKey(keytype):
332
Inserts keytype values in world ipo at curframe. Uses module constants.
333
@type keytype: Integer
346
Make a copy of this world
348
@return: a copy of this world
72
This object gives access to generic data from all worlds in Blender.
73
Its attributes depend upon its type.
75
@ivar skytype: type of the sky. Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
77
@ivar mistype: type of mist : O : quadratic; 1 : linear; 2 : square
78
@ivar hor: the horizon color of a world object.
79
@ivar zen: the zenith color of a world object.
80
@ivar amb: the ambient color of a world object.
81
@ivar star: the star parameters of a world object. See getStar for the semantics of these parameters.
82
@ivar mist: the mist parameters of a world object. See getMist for the semantics of these parameters.
83
@type ipo: Blender Ipo
84
@ivar ipo: The world type ipo linked to this world object.
89
Retrieves the range parameter of a world object.
96
Sets the range parameter of a world object.
98
@param range: the new range parameter
105
Retrieves the name of a world object
107
@return: the name of the world object.
112
Sets the name of a world object.
114
@param name : the new name.
121
Get the Ipo associated with this world object, if any.
123
@return: the wrapped ipo or None.
128
Link an ipo to this world object.
129
@type ipo: Blender Ipo
130
@param ipo: a "camera data" ipo.
135
Unlink the ipo from this world object.
136
@return: True if there was an ipo linked or False otherwise.
141
Retrieves the skytype of a world object.
142
The skytype is a combination of 3 bits : Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
144
@return: the skytype of the world object.
147
def setSkytype(skytype):
149
Sets the skytype of a world object.
150
See getSkytype for the semantics of the parameter.
152
@param skytype : the new skytype.
159
Retrieves the mode of a world object.
160
The mode is a combination of 5 bits:
161
- Bit 0 : mist simulation
162
- Bit 1 : starfield simulation
164
- Bit 4 : ambient occlusion
166
@return: the mode of the world object.
171
Sets the mode of a world object.
172
See getMode for the semantics of the parameter.
174
@param mode : the new mode.
181
Retrieves the mist type of a world object.
182
The mist type is an integer 0 : quadratic; 1 : linear; 2 : square.
184
@return: the mistype of the world object.
187
def setMistype(mistype):
189
Sets the mist type of a world object.
190
See getMistype for the semantics of the parameter.
192
@param mistype : the new mist type.
199
Retrieves the horizon color of a world object.
200
This color is a list of 3 floats.
201
@rtype: list of three floats
202
@return: the horizon color of the world object.
207
Sets the horizon color of a world object.
208
@type hor: list of three floats
209
@param hor : the new hor.
216
Retrieves the zenith color of a world object.
217
This color is a list of 3 floats.
218
@rtype: list of three floats
219
@return: the zenith color of the world object.
224
Sets the zenith color of a world object.
225
@type zen: list of three floats
226
@param zen : the new zenith color.
233
Retrieves the ambient color of a world object.
234
This color is a list of 3 floats.
235
@rtype: list of three floats
236
@return: the ambient color of the world object.
241
Sets the ambient color of a world object.
242
@type amb: list of three floats
243
@param amb : the new ambient color.
250
Retrieves the star parameters of a world object.
251
It is a list of nine floats :
252
red component of the color
253
green component of the color
254
blue component of the color
256
minimal distance between the stars
257
average distance between the stars
258
variations of the stars color
259
@rtype: list of nine floats
260
@return: the star parameters
265
Sets the star parameters of a world object.
266
See getStar for the semantics of the parameter.
267
@type star: list of 9 floats
268
@param star : the new star parameters.
275
Retrieves the mist parameters of a world object.
276
It is a list of four floats :
277
intensity of the mist
281
@rtype: list of four floats
282
@return: the mist parameters
287
Sets the mist parameters of a world object.
288
See getMist for the semantics of the parameter.
289
@type mist: list of 4 floats
290
@param mist : the new mist parameters.
295
def getScriptLinks (event):
297
Get a list with this World's script links of type 'event'.
299
@param event: "FrameChanged", "Redraw", "Render".
301
@return: a list with Blender L{Text} names (the script links of the given
302
'event' type) or None if there are no script links at all.
305
def clearScriptLinks (links = None):
307
Delete script links from this World :). If no list is specified, all
308
script links are deleted.
309
@type links: list of strings
310
@param links: None (default) or a list of Blender L{Text} names.
313
def addScriptLink (text, event):
315
Add a new script link to this World.
317
@param text: the name of an existing Blender L{Text}.
319
@param event: "FrameChanged", "Redraw" or "Render".
324
Make this world active in the current scene.
329
def insertIpoKey(keytype):
331
Inserts keytype values in world ipo at curframe. Uses module constants.
332
@type keytype: Integer
345
Make a copy of this world
347
@return: a copy of this world
351
World.__doc__ += id_generics.attributes