Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Effect.py « doc « api2_2x « python « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b503523d3ec0e2949021dc1f3c0b17dd69885666 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
# Blender.Effect module and the Effect PyType effect

"""
The Blender.Effect submodule

B{new}: now L{Get}('objname') (without specifying second paramenter: 'position') returns a list of all effects linked to object "objname".

INTRODUCTION

The module effect allows you to access all the data of an effect.
An effect can modify an object (typically a mesh) in three different ways.

a) the build effect : makes the mesh appear progressively.

b) the wave effect : waves appear on the mesh (which should be fine-grained)

c) the particle effect : every vertex of the mesh emits particles, which can themselves emit new particles. This effect is the most parameterizable.

In the blender internals, the effect object is just a placeholder for the "real"
effect, which can be a wave, particle or build effect. The python API follows
this structure : the Effect module grants access to (the few) data which
are shared between all effects. It has three submodules : Wave, Build, Particle
, which grant r/w access to the real parameters of these effects.

Example::
  import Blender
	listffects = Blender.Effect.Get()
	print listeffects
	eff = listeffects[0]
	#we suppose the first effect is a build effect
	print eff.getLen()
	eff.setLen(500)	
"""

def New (type):
  """
  Creates a new Effect.
  @type type: string
  @param type: Effect type. Can be "wave", "particle" or "build"
  @rtype: Blender Effect
  @return: The created Effect.
  """

def Get (objname, position = None):
  """
  Get an Effect from Blender.
  @type objname: string
  @param objname: The name of object to which is linked the effect.
  @type position: int
  @param position: The position of the effect in the list of effects linked to the object.
  @rtype: Blender Effect or a list of Blender Effects
  @return: It depends on the 'objname, position' parameters:
      - (objname): A list with all Effects linked to the given object (new);
      - (objname, position): The Effect linked to the given object at the given position;
      - ():     A list with all Effects in the current scene.
  """


class Effect:
  """
  The Effect object
  =================
  This object gives access to generic data from all effects in Blender.
  Its attributes depend upon its type.
	
  @cvar seed: (Particle effects) seed of the RNG.
  @cvar nabla: (Particle effects) The nabla value .
  @cvar sta: (Particle effects) start time of the effect.
  @cvar end: (Particle effects) end time of the effect
  @cvar lifetime: (Particle and Wave effects)lifetime of the effect
  @cvar normfac: (Particle effects) normal strength of the particles (relatively to mesh).
  @cvar obfac: (Particle effects)initial strength of the particles relatively to objects.
  @cvar randfac: (Particle effects) initial random speed of the particles.
  @cvar texfac: (Particle effects) initial speed of the particles caused by the texture.
  @cvar randlife: (Particle effects) variability of the life of the particles.
  @cvar vectsize: (Particle effects) size of vectors associated to the particles (if any).
  @cvar totpart: (Particle effects) total number of particles.
  @cvar force: (Particle effects) constant force applied to the parts.
  @cvar mult: (Particle effects) probabilities of a particle having a child.
  @cvar child: (Particle effects) number of children a particle may have.
  @cvar mat: (Particle effects) materials used by the 4 generation particles.
  @cvar defvec: (Particle effects)x, y and z axis of the force defined by the texture.
  @cvar sfra: (Build effects)  starting frame of the build effect.
  @cvar len: (Build effects)  length     of the build effect. 
  @cvar timeoffs: (Wave effects)  time offset of the wave effect.  
  @cvar damp: (Wave effects)    damp factor  of the wave effect.   
  @cvar minfac: (Wave effects)   
  @cvar speed: (Wave effects)  speed of the wave effect.    
  @cvar narrow: (Wave effects)narrowness   of the wave effect.   
  @cvar width: (Wave effects) width of the wave effect.  
  @cvar height: (Wave effects)  height of the wave effect.    
  @cvar startx: (Wave effects) x-position of the origin  of the wave effect.   
  @cvar starty: (Wave effects) y-position of the origin  of the wave effect. 
  """

  def getType():
    """
    Retrieves the type of an effect object
    @rtype: int 
    @return:  the type of an effect object : 0 = build effect;  1 = wave effect;2 = particle effect;
    """

	
  def setType(name):
    """
    Sets the type of an effect object
    @type name: int
    @param name : the new type. 
    @rtype: PyNone
    @return:  PyNone
    """

  def getFlag():
    """
    Retrieves the flag of an effect object.  The flag is a bit-mask.
    @rtype: int 
    @return:  The flag of the effect is a combination of parameters, whose semantics depend upon the effect type.
      - All types :
          Bit 0 : set to 1 if the effect is selected in the effects window.
      - Wave effect :
          Bits 1,2,3  :  set to 1 if the button "X", "Y" or "Cycl" is clicked.
      - Particle effect :
          Bits 1,2,3 :  set to 1 if the button "Bspline", "Static" or "Face" is clicked.

    """

	
  def setFlag(newflag):
    """
    Sets the flag of an effect object. See L{getFlag()} for bit values.
    @type newflag: int
    @param newflag: the new flag. 
    @rtype: PyNone
    @return:  PyNone
    """

	

  def getLen():
    """
    (Build Effect) Retrieves the length of an build effect object
    @rtype: int 
    @return:  the length of the effect.
    """

	
  def setLen(newlength):
    """
    (Build Effect) Sets the length of an build effect object
    @type newlength: int
    @param newlength: the new length. 
    @rtype: PyNone
    @return:  PyNone
    """

	

  def getSfra():
    """
    (Build Effect) Retrieves the starting frame of an build effect object
    @rtype: int 
    @return:  the starting frame of the effect.
    """

	
  def setSfra(sfra):
    """
    (Build Effect) Sets the starting frame of an build effect object
    @type sfra: int
    @param sfra: the new starting frame. 
    @rtype: PyNone
    @return:  PyNone
    """

  def getStartx():
    """
    (Wave Effect) Retrieves the x-coordinate of the starting point of the wave.
    @rtype: float
    @return:  the x-coordinate of the starting point of the wave.
    """

	
  def setStartx(startx):
    """
    (Wave Effect) Sets the x-coordinate of the starting point of the wave.
    @type startx: float
    @param startx: the new x-coordinate of the starting point of the wave.
    @rtype: PyNone
    @return:  PyNone
    """

	

  def getStarty():
    """
    (Wave Effect) Retrieves the y-coordinate of the starting point of the wave.
    @rtype: float
    @return:  the y-coordinate of the starting point of the wave.
    """

	
  def setStarty(starty):
    """
    (Wave Effect) Sets the y-coordinate of the starting point of the wave.
    @type starty: float
    @param starty: the new y-coordinate of the starting point of the wave.
    @rtype: PyNone
    @return:  PyNone
    """

	

  def getHeight():
    """
    (Wave Effect) Retrieves the height of the wave.
    @rtype: float
    @return:  the height of the wave.
    """

	
  def setHeight(height):
    """
    (Wave Effect) Sets the height of the wave.
    @type height: float
    @param height:  the height of the wave.
    @rtype: PyNone
    @return:  PyNone
    """


  def getWidth():
    """
    (Wave Effect) Retrieves the width of the wave.
    @rtype: float
    @return:  the width of the wave.
    """

	
  def setWidth(width):
    """
    (Wave Effect) Sets the width of the wave.
    @type width: float
    @param width:  the width of the wave.
    @rtype: PyNone
    @return:  PyNone
    """

  def getNarrow():
    """
    (Wave Effect) Retrieves the narrowness of the wave.
    @rtype: float
    @return:  the narrowness of the wave.
    """

	
  def setNarrow(narrow):
    """
    (Wave Effect) Sets the narrowness of the wave.
    @type narrow: float
    @param narrow:  the narrowness of the wave.
    @rtype: PyNone
    @return:  PyNone
    """

  def getSpeed():
    """
    (Wave Effect) Retrieves the speed of the wave.
    @rtype: float
    @return:  the speed of the wave.
    """

	
  def setSpeed(speed):
    """
    (Wave Effect) Sets the speed of the wave.
    @type speed: float
    @param speed:  the speed of the wave.
    @rtype: PyNone
    @return:  PyNone
    """

	
  def getMinfac():
    """
    (Wave Effect) Retrieves the minfac of the wave.
    @rtype: float
    @return:  the minfac of the wave.
    """

	
  def setMinfac(minfac):
    """
    (Wave Effect) Sets the minfac of the wave.
    @type minfac: float
    @param minfac:  the minfac of the wave.
    @rtype: PyNone
    @return:  PyNone
    """

	
  def getDamp():
    """
    (Wave Effect) Retrieves the damp of the wave.
    @rtype: float
    @return:  the damp of the wave.
    """

	
  def setDamp(damp):
    """
    (Wave Effect) Sets the damp of the wave.
    @type damp: float
    @param damp:  the damp of the wave.
    @rtype: PyNone
    @return:  PyNone
    """

	
  def getTimeoffs():
    """
    (Wave Effect) Retrieves the time offset of the wave.
    @rtype: float
    @return:  the time offset of the wave.
    """

	
  def setTimeoffs(timeoffs):
    """
    (Wave Effect) Sets the time offset of the wave.
    @type timeoffs: float
    @param timeoffs:  the time offset of the wave.
    @rtype: PyNone
    @return:  PyNone
    """

		
  def getLifetime():
    """
    (Wave Effect) Retrieves the life time of the wave.
    @rtype: float
    @return:  the life time of the wave.
    """

	
  def setLifetime(lifetime):
    """
    (Wave Effect) Sets the life time of the wave.
    @type lifetime: float
    @param lifetime:  the life time of the wave.
    @rtype: PyNone
    @return:  PyNone
    """


  def getSta():
    """
    (Particle Effect) Retrieves the starting time of a particle effect object
    @rtype: float
    @return:  the starting time of the effect.
    """

	
  def setSta(newstart):
    """
    (Particle Effect) Sets the starting time of an particle effect object
    @type newstart: float
    @param newstart: the new starting time. 
    @rtype: PyNone
    @return:  PyNone
    """

  def getEnd():
    """
    (Particle Effect) Retrieves the end time of a particle effect object
    @rtype: float 
    @return:  the end time of the effect.
    """

	
  def setEnd(newendrt):
    """
    (Particle Effect) Sets the end time of an particle effect object
    @type newendrt: float
    @param newendrt: the new end time. 
    @rtype: PyNone
    @return:  PyNone
    """
		
  def getLifetime():
    """
    (Particle Effect) Retrieves the lifetime of a particle effect object
    @rtype: float 
    @return:  the lifetime of the effect.
    """

	
  def setLifetime(newlifetime):
    """
    (Particle Effect) Sets the lifetime of a particle effect object
    @type newlifetime: float
    @param newlifetime: the new lifetime. 
    @rtype: PyNone
    @return:  PyNone
    """

  def getNormfac():
    """
    (Particle Effect) Retrieves the  normal strength of the particles (relatively to mesh).
    @rtype: float 
    @return:  normal strength of the particles (relatively to mesh).
    """

	
  def setNormfac(newnormfac):
    """
    (Particle Effect) Sets the normal strength of the particles (relatively to mesh).
    @type newnormfac: float
    @param newnormfac: the normal strength of the particles (relatively to mesh). 
    @rtype: PyNone
    @return:  PyNone
    """
		
  def getObfac():
    """
    (Particle Effect) Retrieves the initial strength of the particles relatively to objects.
    @rtype: float 
    @return: initial strength of the particles (relatively to mesh).
    """

	
  def setObfac(newobfac):
    """
    (Particle Effect) Sets the initial strength of the particles relatively to objects.
    @type newobfac: float
    @param newobfac: the initial strength of the particles relatively to objects.
    @rtype: PyNone
    @return:  PyNone
    """

  def getRandfac():
    """
    (Particle Effect) Retrieves the random  strength applied to the particles.
    @rtype: float 
    @return: random  strength applied to the particles.
    """

	
  def setRandfac(newrandfac):
    """
    (Particle Effect) Sets the random  strength applied to the particles. 
    @type newrandfac: float
    @param newrandfac: the random  strength applied to the particles.
    @rtype: PyNone
    @return:  PyNone
    """

  def getTexfac():
    """
    (Particle Effect) Retrieves the strength applied to the particles from the texture of the object.
    @rtype: float 
    @return: strength applied to the particles from the texture of the object.
    """

	
  def setTexfac(newtexfac):
    """
    (Particle Effect) Sets the strength applied to the particles from the texture of the object. 
    @type newtexfac: float
    @param newtexfac: the strength applied to the particles from the texture of the object.
    @rtype: PyNone
    @return:  PyNone
    """

  def getRandlife():
    """
    (Particle Effect) Retrieves the  variability of the life of the particles.
    @rtype: float 
    @return: variability of the life of the particles.
    """

	
  def setRandlife(newrandlife):
    """
    (Particle Effect) Sets the variability of the life of the particles.
    @type newrandlife: float
    @param newrandlife: the variability of the life of the particles.
    @rtype: PyNone
    @return:  PyNone
    """

  def getNabla():
    """
    (Particle Effect) Retrieves the sensibility of the particles to the variations of the texture.
    @rtype: float 
    @return: sensibility of the particles to the variations of the texture.
    """

	
  def setNabla(newnabla):
    """
    (Particle Effect) Sets the sensibility of the particles to the variations of the texture.
    @type newnabla: float
    @param newnabla: the sensibility of the particles to the variations of the texture.
    @rtype: PyNone
    @return:  PyNone
    """

  def getVectsize():
    """
    (Particle Effect) Retrieves the size of the vector which is associated to the particles.
    @rtype: float 
    @return: size of the vector which is associated to the particles.
    """

	
  def setVectsize(newvectsize):
    """
    (Particle Effect) Sets the size of the vector which is associated to the particles.
    @type newvectsize: float
    @param newvectsize: the size of the vector which is associated to the particles.
    @rtype: PyNone
    @return:  PyNone
    """

  def getTotpart():
    """
    (Particle Effect) Retrieves the total number of particles.
    @rtype: int 
    @return: the total number of particles.
    """

	
  def setTotpart(newtotpart):
    """
    (Particle Effect) Sets the the total number of particles.
    @type newtotpart: int
    @param newtotpart: the the total number of particles.
    @rtype: PyNone
    @return:  PyNone
    """

  def getTotkey():
    """
    (Particle Effect) Retrieves the number of keys associated to the particles (kind of degree of freedom)
    @rtype: int 
    @return: number of keys associated to the particles.
    """

	
  def setTotkey(newtotkey):
    """
    (Particle Effect) Sets the number of keys associated to the particles.
    @type newtotkey: int
    @param newtotkey: number of keys associated to the particles.
    @rtype: PyNone
    @return:  PyNone
    """

  def getSeed():
    """
    (Particle Effect) Retrieves the RNG seed.
    @rtype: int 
    @return:  RNG seed.
    """

	
  def setSeed(newseed):
    """
    (Particle Effect) Sets the  RNG seed.
    @type newseed: int
    @param newseed:  RNG seed.
    @rtype: PyNone
    @return:  PyNone
    """

  def getForce():
    """
    (Particle Effect) Retrieves the force applied to the particles.
    @rtype: list of three floats 
    @return:   force applied to the particles.
    """

	
  def setForce(newforce):
    """
    (Particle Effect) Sets the force applied to the particles.
    @type newforce: list of 3 floats
    @param newforce:  force applied to the particles.
    @rtype: PyNone
    @return:  PyNone
    """

  def getMult():
    """
    (Particle Effect) Retrieves the probabilities of a particle having a child.
    @rtype: list of 4 floats 
    @return:  probabilities of a particle having a child.
    """

	
  def setMult(newmult):
    """
    (Particle Effect) Sets the probabilities of a particle having a child.
    @type newmult: list of 4 floats
    @param newmult:  probabilities of a particle having a child.
    @rtype: PyNone
    @return:  PyNone
    """
		
  def getLife():
    """
    (Particle Effect) Retrieves the average life of the particles (4 generations)
    @rtype: list of 4 floats 
    @return: average life of the particles (4 generations)
    """

	
  def setLife(newlife):
    """
    (Particle Effect) Sets the average life of the particles (4 generations).
    @type newlife: list of 4 floats
    @param newlife:  average life of the particles (4 generations).
    @rtype: PyNone
    @return:  PyNone
    """
		
  def getChild():
    """
    (Particle Effect) Retrieves the average number of children of the particles (4 generations).
    @rtype: list of 4 floats 
    @return: average number of children of the particles (4 generations).
    """

	
  def setChild(newchild):
    """
    (Particle Effect) Sets the average number of children of the particles (4 generations).
    @type newchild: list of 4 floats
    @param newchild:  average number of children of the particles (4 generations).
    @rtype: PyNone
    @return:  PyNone
    """

  def getMat():
    """
    (Particle Effect) Retrieves the indexes of the materials associated to the particles (4 generations).
    @rtype: list of 4 floats 
    @return: indexes of the materials associated to the particles (4 generations).
    """

	
  def setMat(newmat):
    """
    (Particle Effect) Sets the indexes of the materials associated to the particles (4 generations).
    @type newmat: list of 4 floats
    @param newmat:   the indexes of the materials associated to the particles (4 generations).
    @rtype: PyNone
    @return:  PyNone
    """


  def getDefvec():
    """
    (Particle Effect) Retrieves the x, y and z components of the force defined by the texture.
    @rtype: list of 3 floats 
    @return: x, y and z components of the force defined by the texture.
    """

	
  def setDefvec(newdefvec):
    """
    (Particle Effect) Sets the x, y and z components of the force defined by the texture.
    @type newdefvec: list of 3 floats
    @param newdefvec:   the x, y and z components of the force defined by the texture.
    @rtype: PyNone
    @return:  PyNone
    """