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

« back to all changes in this revision

Viewing changes to source/blender/python/api2_2x/doc/Metaball.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:
6
6
This module provides access to the B{Metaball Data} in Blender.
7
7
 
8
8
Example::
9
 
  import Blender
10
 
  scene = Blender.Scene.getCurrent ()   # get the current scene
11
 
  ob = Blender.Metaball.New ('mball')   # make  metaball
 
9
 import Blender
 
10
 
 
11
 ob =  Blender.Object.New("Mball","mb")
 
12
 mb = Blender.Metaball.New()
 
13
 for i in range(20):
 
14
   mb.addMetaelem([0, float(i),1.0,1.0, 2.0,1,2.0,1.0,1.0,1.0])
 
15
 ob.link(mb)
 
16
 sc = Blender.Scene.getCurrent()
 
17
 sc.link(ob)
12
18
"""
13
19
 
 
20
 
14
21
def New (name):
15
22
  """
16
23
  Creates a new Metaball.
31
38
      - ():     A list with all Metaballs in the current scene.
32
39
  """
33
40
 
34
 
 
35
41
class Metaball:
36
42
  """
37
43
  The Metaball object
38
44
  ===================
39
45
  This metaball gives access to generic data from all metaballs in Blender.
40
 
  @cvar name: The name of the metaball.
41
 
  @cvar loc: The location of the metaball.
42
 
  @cvar rot: The rotation of the metaball.
43
 
  @cvar size: The size of the metaball.
 
46
  @ivar name: The name of the metaball.
 
47
  @ivar loc: The location of the metaball.
 
48
  @ivar rot: The rotation of the metaball.
 
49
  @ivar size: The size of the metaball.
44
50
  """
45
51
 
 
52
  def addMetaelem(paramslist):
 
53
    """
 
54
    Add a new metaelem to this metaball. 'paramslist' must have the
 
55
    following ten elements:
 
56
      - param 1: int - metaelem type:
 
57
        - 0 for a sphere
 
58
        - 1 for a tubex
 
59
        - 2 for a tubey
 
60
        - 3 for a tubez
 
61
        - 4 for a regular tube
 
62
        - 5 for a plane
 
63
        - 6 for an ellipsoid
 
64
        - 7 for a cube
 
65
      - params 2,3,4: floats - the x, y and z coordinates of the metaelem.
 
66
      - param 5: float - the rad value of the metaelem.
 
67
      - param 6: int - the lay value.
 
68
      - param 7: float - the s value of the metaelem.
 
69
      - params 8,9,10: floats - the expx, expy and expz values of the metaelem.
 
70
    @type paramslist: list
 
71
    @param paramslist: the list of the parameters for creating a new metaelem.
 
72
    @rtype: None
 
73
    @return:  None
 
74
    """
 
75
 
 
76
                
 
77
  def getMetaElemList():
 
78
    """
 
79
    retreives the list of the Metaelems of the Metaball
 
80
    @rtype: List
 
81
    @return:  List of Metaelem classes
 
82
                Each Metaelem object has NO function, but 4 read/write fields\n
 
83
                coords : a list of three floats, the coordinates of the Metaelem object\n
 
84
                dims :  a list of three floats, the dimensions of the meteelem object\n
 
85
                rad : a float, the radius of the object\n
 
86
                stif : a float, the stifness of the object\n
 
87
                Example : \n
 
88
                import Blender\n
 
89
 
 
90
                mb = Blender.Metaball.Get("mball")\n
 
91
                ob = Blender.Object.Get("ob")\n
 
92
                ll =  mb.getMetaElemList()\n
 
93
                me = ll[0]\n
 
94
                old = me.coords\n
 
95
                new = [old[0],old[1],old[2]-.02]\n
 
96
                me.coords = new\n
 
97
 
 
98
                ob.makeDisplayList()\n
 
99
                Blender.Window.QRedrawAll()
 
100
                """
 
101
 
46
102
  def getName():
47
103
    """
48
 
    Retreives the name of a metaball object
 
104
    Retrieves the name of a metaball object.
49
105
    @rtype: string
50
 
    @return:  the name of a metaball object
 
106
    @return:  the name of a metaball object.
51
107
    """
52
108
 
53
 
        
 
109
  
54
110
  def setName(name):
55
111
    """
56
 
    Sets the name of a metaball object
 
112
    Sets the name of a metaball object.
57
113
    @type name: string
58
114
    @param name : the new name
59
 
    @rtype: PyNone
60
 
    @return:  PyNone
 
115
    @rtype: None
 
116
    @return:  None
61
117
    """
62
118
 
63
 
        
 
119
  
64
120
 
65
121
  def getBbox():
66
122
    """
67
 
    Retreives the bounding box of a metaball object
 
123
    Retrieves the bounding box of a metaball object.
68
124
    @rtype: a list of 24 floats(8 points, 3 coordinates)
69
125
    @return:  the bounding box of a metaball object
70
126
    """
71
127
 
72
128
  def getNMetaElems():
73
129
    """
74
 
    Retreives the number of metaelems (elementary spheres or cylinders) of a metaball object
 
130
    Retrieves the number of metaelems (elementary spheres or cylinders) of a metaball object.
75
131
    @rtype: int
76
132
    @return: number of metaelems of a metaball object
77
133
    """
78
134
 
79
135
  def getLoc():
80
136
    """
81
 
    Retreives the location of a metaball object
 
137
    Retrieves the location of a metaball object.
82
138
    @rtype: a list of 3 floats
83
 
    @return: locationof a metaball object
 
139
    @return: location of a metaball object
84
140
    """
85
141
 
86
142
  def setLoc(newloc):
87
143
    """
88
 
    Sets the location of a metaball object
 
144
    Sets the location of a metaball object.
89
145
    @type newloc: list of 3 floats
90
146
    @param newloc: the new location
91
 
    @rtype: PyNone
92
 
    @return: PyNone
 
147
    @rtype: None
 
148
    @return: None
93
149
    """
94
150
 
95
151
  def getRot():
96
152
    """
97
 
    Retreives the rotation of a metaball object
 
153
    Retrieves the rotation of a metaball object.
98
154
    @rtype: a list of 3 floats
99
 
    @return: rotationof a metaball object
 
155
    @return: rotation of a metaball object
100
156
    """
101
157
 
102
158
  def setRot(newrot):
103
159
    """
104
 
    Sets the rotation of a metaball object
 
160
    Sets the rotation of a metaball object.
105
161
    @type newrot: list of 3 floats
106
162
    @param newrot: the new rotation
107
 
    @rtype: PyNone
108
 
    @return: PyNone
 
163
    @rtype: None
 
164
    @return: None
109
165
    """
110
166
 
111
167
  def getSize():
112
168
    """
113
 
    Retreives the size of a metaball object
 
169
    Retrieves the size of a metaball object.
114
170
    @rtype: a list of 3 floats
115
171
    @return: size a metaball object
116
172
    """
117
173
 
118
174
  def setSize(newsize):
119
175
    """
120
 
    Sets the size of a metaball object
 
176
    Sets the size of a metaball object.
121
177
    @type newsize: list of 3 floats
122
178
    @param newsize: the new size
123
 
    @rtype: PyNone
124
 
    @return: PyNone
 
179
    @rtype: None
 
180
    @return: None
125
181
    """
126
182
 
127
183
  def getWiresize():
128
184
    """
129
 
    Retreives the wiresize of a metaball object
 
185
    Retrieves the wiresize of a metaball object.
130
186
    @rtype: float
131
187
    @return: wire size a metaball object
132
188
    """
133
189
 
134
190
  def setWiresize(newsize):
135
191
    """
136
 
    Sets the wire size of a metaball object
 
192
    Sets the wire size of a metaball object.
137
193
    @type newsize: float
138
194
    @param newsize: the new size
139
 
    @rtype: PyNone
140
 
    @return: PyNone
 
195
    @rtype: None
 
196
    @return: None
141
197
    """
142
198
  def getRendersize():
143
199
    """
144
 
    Retreives the rendersize of a metaball object
 
200
    Retrieves the rendersize of a metaball object.
145
201
    @rtype: float
146
202
    @return: render size a metaball object
147
203
    """
148
204
 
149
205
  def setRendersize(newsize):
150
206
    """
151
 
    Sets the render size of a metaball object
 
207
    Sets the render size of a metaball object.
152
208
    @type newsize: float
153
209
    @param newsize: the new size
154
 
    @rtype: PyNone
155
 
    @return: PyNone
 
210
    @rtype: None
 
211
    @return: None
156
212
    """
157
213
 
158
214
  def getThresh():
159
215
    """
160
 
    Retreives the threshold of a metaball object
 
216
    Retrieves the threshold of a metaball object.
161
217
    @rtype: float
162
218
    @return: threshold of the metaball object
163
219
    """
164
220
 
165
221
  def setThresh(threshold):
166
222
    """
167
 
    Sets the threshold of a metaball object
 
223
    Sets the threshold of a metaball object.
168
224
    @type threshold: float
169
225
    @param threshold: the new size
170
 
    @rtype: PyNone
171
 
    @return: PyNone
 
226
    @rtype: None
 
227
    @return: None
172
228
    """
173
229
 
174
230
  def getMetadata(name,num):
184
240
 
185
241
  def setMetadata(name,num,val):
186
242
    """
187
 
    The setMetadata function has the same semantics as getMetadata,             except that it needs  the parameter value, and always returns PyNone.
 
243
    The setMetadata function has the same semantics as getMetadata,   except that it needs  the parameter value, and always returns None.
188
244
    @type name: string
189
245
    @param name: the name of the property to be read. The accepted values are :"type", "x", "y", "z", "expx", "expy", "expz", "rad", "rad2", "s", "len".
190
246
    @type num: int
191
247
    @param num: the position of the metaelem to be accessed.
192
248
    @type val: float, except if name is "type".
193
249
    @param val: the new value of the parameter.
194
 
    @rtype: PyNone
195
 
    @return: PyNone
 
250
    @rtype: None
 
251
    @return: None
196
252
    """
197
253
 
198
254
  def getMetatype(pos):
199
255
    """
200
 
    Retreives the type of a metaelem object
 
256
    Retrieves the type of a metaelem object.
201
257
    @type pos: int
202
 
    @param : the position of the metaelement
 
258
    @param pos: the position of the metaelement
203
259
    @rtype: int
204
260
    @return: type of the metaelem object
205
261
    """
206
262
 
207
263
  def setMetatype(pos,newtype):
208
264
    """
209
 
    Sets the type of a metaelem object
 
265
    Sets the type of a metaelem object.
210
266
    @type pos: int
211
 
    @param : the position of the metaelement
 
267
    @param pos: the position of the metaelement
212
268
    @type newtype: int
213
269
    @param newtype: the new type
214
 
    @rtype: PyNone
215
 
    @return: PyNone
 
270
    @rtype: None
 
271
    @return: None
216
272
    """
217
273
 
218
274
  def getMetax(pos):
219
275
    """
220
 
    Retreives the x parameter of a metaelem object
 
276
    Retrieves the x parameter of a metaelem object.
221
277
    @type pos: int
222
 
    @param : the position of the metaelement
 
278
    @param pos: the position of the metaelement
223
279
    @rtype: float
224
280
    @return: x parameter of the metaelem object
225
281
    """
226
282
 
227
283
  def setMetax(pos,newx):
228
284
    """
229
 
    Sets the x parameter of a metaelem object
 
285
    Sets the x parameter of a metaelem object.
230
286
    @type pos: int
231
 
    @param : the position of the metaelement
 
287
    @param pos: the position of the metaelement
232
288
    @type newx: float
233
289
    @param newx: the new x parameter value
234
 
    @rtype: PyNone
235
 
    @return: PyNone
 
290
    @rtype: None
 
291
    @return: None
236
292
    """
237
293
 
238
294
  def getMetay(pos):
239
295
    """
240
 
    Retreives the y parameter of a metaelem object
 
296
    Retrieves the y parameter of a metaelem object.
241
297
    @type pos: int
242
 
    @param : the position of the metaelement
 
298
    @param pos: the position of the metaelement
243
299
    @rtype: float
244
300
    @return: y parameter of the metaelem object
245
301
    """
246
302
 
247
303
  def setMetay(pos,newy):
248
304
    """
249
 
    Sets the y parameter of a metaelem object
 
305
    Sets the y parameter of a metaelem object.
250
306
    @type pos: int
251
 
    @param : the position of the metaelement
 
307
    @param pos: the position of the metaelement
252
308
    @type newy: float
253
309
    @param newy: the new y parameter value
254
 
    @rtype: PyNone
255
 
    @return: PyNone
 
310
    @rtype: None
 
311
    @return: None
256
312
    """
257
313
 
258
314
  def getMetaz(pos):
259
315
    """
260
 
    Retreives the z parameter of a metaelem object
 
316
    Retrieves the z parameter of a metaelem object.
261
317
    @type pos: int
262
 
    @param : the position of the metaelement
 
318
    @param pos: the position of the metaelement
263
319
    @rtype: float
264
320
    @return: z parameter of the metaelem object
265
321
    """
266
322
 
267
323
  def setMetaz(pos,newz):
268
324
    """
269
 
    Sets the z parameter of a metaelem object
 
325
    Sets the z parameter of a metaelem object.
270
326
    @type pos: int
271
 
    @param : the position of the metaelement
 
327
    @param pos: the position of the metaelement
272
328
    @type newz: float
273
329
    @param newz: the new z parameter value
274
 
    @rtype: PyNone
275
 
    @return: PyNone
 
330
    @rtype: None
 
331
    @return: None
276
332
    """
277
333
 
278
334
 
279
335
  def getMetas(pos):
280
336
    """
281
 
    Retreives the s parameter of a metaelem object
 
337
    Retrieves the s parameter of a metaelem object.
282
338
    @type pos: int
283
 
    @param : the position of the metaelement
 
339
    @param pos: the position of the metaelement
284
340
    @rtype: float
285
341
    @return: s parameter of the metaelem object
286
342
    """
287
343
 
288
344
  def setMetas(pos,news):
289
345
    """
290
 
    Sets the s parameter of a metaelem object
 
346
    Sets the s parameter of a metaelem object.
291
347
    @type pos: int
292
 
    @param : the position of the metaelement
 
348
    @param pos: the position of the metaelement
293
349
    @type news: float
294
350
    @param news: the new x parameter value
295
 
    @rtype: PyNone
296
 
    @return: PyNone
 
351
    @rtype: None
 
352
    @return: None
297
353
    """
298
354
 
299
355
  def getMetalen(pos):
300
356
    """
301
 
    Retreives the len parameter of a metaelem object
 
357
    Retrieves the len parameter of a metaelem object.
302
358
    @type pos: int
303
 
    @param : the position of the metaelement
 
359
    @param pos: the position of the metaelement
304
360
    @rtype: float
305
361
    @return: len parameter of the metaelem object
306
362
    """
307
363
 
308
364
  def setMetalen(pos,newlen):
309
365
    """
310
 
    Sets the len parameter of a metaelem object
 
366
    Sets the len parameter of a metaelem object.
311
367
    @type pos: int
312
 
    @param : the position of the metaelement
 
368
    @param pos: the position of the metaelement
313
369
    @type newlen: float
314
370
    @param newlen: the new x parameter value
315
 
    @rtype: PyNone
316
 
    @return: PyNone
 
371
    @rtype: None
 
372
    @return: None
317
373
    """