~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/python/api2_2x/doc/World.py

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
"""
4
4
The Blender.World submodule
5
5
 
6
 
INTRODUCTION
 
6
B{New}: L{World.clearScriptLinks} accepts a parameter now.
 
7
 
 
8
World
 
9
=====
7
10
 
8
11
The module world allows you to access all the data of a Blender World.
9
12
 
12
15
  w = Blender.Get('World') #assume there exists a world named "world"
13
16
  print w.getName()
14
17
  w.hor = [1,1,.2]
15
 
  print w.getHor()      
 
18
  print w.getHor()
 
19
 
 
20
Example::
 
21
  import Blender
 
22
  from Blender import *
 
23
 
 
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
 
28
 
 
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
 
31
 
 
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
 
34
 
 
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
 
37
 
 
38
  blending = AllWorlds[0].getSkytype() # get the blending modes (real, blend, paper) of the first world object  
16
39
"""
17
40
 
18
41
def New (name):
21
44
  @type name: string
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.
25
48
  """
26
49
 
27
50
def Get (name):
36
59
  """
37
60
 
38
61
 
 
62
def GetCurrent ():
 
63
  """
 
64
  Get the active world of the scene.
 
65
  @rtype: Blender World or None
 
66
  """
 
67
 
39
68
class World:
40
69
  """
41
70
  The World object
42
71
  ================
43
72
  This object gives access to generic data from all worlds in Blender.
44
73
  Its attributes depend upon its type.
45
 
        
46
 
  @cvar name: the name of the world.
47
 
  @cvar skytype: type of the sky. Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
48
 
  @cvar mode:
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. 
 
74
 
 
75
  @ivar name: the name of the world.
 
76
  @ivar skytype: type of the sky. Bit 0 : Blend; Bit 1 : Real; Bit 2 : paper.
 
77
  @ivar mode:
 
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.
57
86
  """
 
87
 
 
88
  def getRange():
 
89
    """
 
90
    Retrieves the range parameter of a world object.
 
91
    @rtype: float
 
92
    @return: the range
 
93
    """
 
94
 
 
95
  def setRange(range):
 
96
    """
 
97
    Sets the range parameter of a world object.
 
98
    @type range: float
 
99
    @param range: the new range parameter
 
100
    @rtype: PyNone
 
101
    @return: PyNone
 
102
    """
58
103
 
59
104
  def getName():
60
105
    """
61
 
    Retreives the name of an world object
 
106
    Retrieves the name of an world object
62
107
    @rtype: string
63
108
    @return:  the name of the world object.
64
109
    """
94
139
 
95
140
  def getSkytype():
96
141
    """
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.
99
144
    @rtype: int
100
145
    @return:  the skytype of the world object.
101
146
    """
102
147
 
103
 
        
104
148
  def setSkytype(skytype):
105
149
    """
106
150
    Sets the skytype of a world object.
113
157
 
114
158
  def getMode():
115
159
    """
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.
118
162
    @rtype: int
119
163
    @return:  the mode of the world object.
120
164
    """
121
165
 
122
 
        
123
166
  def setMode(mode):
124
167
    """
125
168
    Sets the mode of a world object.
132
175
 
133
176
  def getMistype():
134
177
    """
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.
137
180
    @rtype: int
138
181
    @return:  the mistype of the world object.
139
182
    """
140
183
 
141
 
        
142
184
  def setMistype(mistype):
143
185
    """
144
186
    Sets the mist type of a world object.
151
193
 
152
194
  def getHor():
153
195
    """
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.
158
200
    """
159
201
 
160
 
        
161
202
  def setHor(hor):
162
203
    """
163
204
    Sets the horizon color of a world object.
169
210
 
170
211
  def getZen():
171
212
    """
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.
176
217
    """
177
218
 
178
 
        
179
219
  def setZen(zen):
180
220
    """
181
221
    Sets the zenith color of a world object.
187
227
 
188
228
  def getAmb():
189
229
    """
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.
194
234
    """
195
235
 
196
 
        
197
236
  def setAmb(amb):
198
237
    """
199
238
    Sets the ambient color of a world object.
205
244
 
206
245
  def getStar():
207
246
    """
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
218
257
    @return:  the star parameters
219
258
    """
220
259
 
221
 
        
222
260
  def setStar(star):
223
261
    """
224
262
    Sets the star parameters  of a world object.
231
269
 
232
270
  def getMist():
233
271
    """
234
 
    Retreives the mist parameters  of a world object.
 
272
    Retrieves the mist parameters  of a world object.
235
273
    It is a list of four floats :
236
274
    intensity of the mist
237
275
    start of the mist
241
279
    @return:  the mist parameters
242
280
    """
243
281
 
244
 
        
245
282
  def setMist(mist):
246
283
    """
247
284
    Sets the mist parameters  of a world object.
251
288
    @rtype: PyNone
252
289
    @return:  PyNone
253
290
    """
 
291
 
 
292
  def getScriptLinks (event):
 
293
    """
 
294
    Get a list with this World's script links of type 'event'.
 
295
    @type event: string
 
296
    @param event: "FrameChanged", "Redraw", "Render".
 
297
    @rtype: list
 
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.
 
300
    """
 
301
 
 
302
  def clearScriptLinks (links = None):
 
303
    """
 
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.
 
308
    """
 
309
 
 
310
  def addScriptLink (text, event):
 
311
    """
 
312
    Add a new script link to this World.
 
313
    @type text: string
 
314
    @param text: the name of an existing Blender L{Text}.
 
315
    @type event: string
 
316
    @param event: "FrameChanged", "Redraw" or "Render".
 
317
    """
 
318
  
 
319
  def setCurrent ():
 
320
    """
 
321
    Make this world active in the current scene.
 
322
    @rtype: PyNone
 
323
    @return:  PyNone    
 
324
    """ 
 
325
    
 
326
  def insertIpoKey(keytype):
 
327
    """
 
328
    Inserts keytype values in world ipo at curframe. Uses module constants.
 
329
    @type keytype: Integer
 
330
    @param keytype:
 
331
           -ZENTIH
 
332
           -HORIZON
 
333
           -MIST
 
334
           -STARS
 
335
           -OFFSET
 
336
           -SIZE
 
337
    @return: py_none
 
338
    """