Module Particle
[hide private]
[frames] | no frames]

Source Code for Module Particle

  1  # Blender.Object module and the Object PyType object 
  2   
  3  """ 
  4  The Blender.Particle submodule 
  5   
  6   
  7  Particle 
  8  ======== 
  9   
 10  This module provides access to the B{Particle} in Blender. 
 11   
 12  @type TYPE: readonly dictionary 
 13  @var TYPE: Constant dict used for with L{Particle.TYPE} 
 14                  - HAIR: set particle system to hair mode. 
 15                  - REACTOR: set particle system to reactor mode. 
 16                  - EMITTER: set particle system to emitter mode. 
 17  @type DISTRIBUTION: readonly dictionary 
 18  @var DISTRIBUTION: Constant dict used for with L{Particle.DISTRIBUTION} 
 19                  - GRID: set grid distribution. 
 20                  - RANDOM: set random distribution. 
 21                  - JITTERED: set jittered distribution. 
 22  @type EMITFROM: readonly dictionary 
 23  @var EMITFROM: Constant dict used for with L{Particle.EMITFROM} 
 24                  - VERTS: set particles emit from vertices 
 25                  - FACES: set particles emit from faces 
 26                  - VOLUME: set particles emit from volume 
 27                  - PARTICLE: set particles emit from particles 
 28  @type REACTON: readonly dictionary 
 29  @var REACTON: Constant dict used for with L{Particle.REACTON} 
 30                  - NEAR: react on near 
 31                  - COLLISION: react on collision 
 32                  - DEATH: react on death 
 33  @type DRAWAS: readonly dictionary 
 34  @var DRAWAS: Constant dict used for with L{Particle.DRAWAS} 
 35                  - NONE: Don't draw 
 36                  - POINT: Draw as point 
 37                  - CIRCLE: Draw as circles 
 38                  - CROSS: Draw as crosses 
 39                  - AXIS: Draw as axis 
 40                  - LINE: Draw as lines 
 41                  - PATH: Draw pathes 
 42                  - OBJECT: Draw object 
 43                  - GROUP: Draw goup 
 44                  - BILLBOARD: Draw as billboard  
 45  """ 
 46   
47 -class Particle:
48 """ 49 The Particle object 50 =================== 51 This object gives access to paticles data. 52 53 @ivar seed: Set an offset in the random table. 54 @type seed: int 55 @ivar type: Type of particle system ( Particle.TYPE[ 'HAIR' | 'REACTOR' | 'EMITTER' ] ). 56 @type type: int 57 @ivar resolutionGrid: The resolution of the particle grid. 58 @type resolutionGrid: int 59 @ivar startFrame: Frame number to start emitting particles. 60 @type startFrame: float 61 @ivar endFrame: Frame number to stop emitting particles. 62 @type endFrame: float 63 @ivar editable: Finalize hair to enable editing in particle mode. 64 @type editable: int 65 @ivar amount: The total number of particles. 66 @type amount: int 67 @ivar multireact: React multiple times ( Particle.REACTON[ 'NEAR' | 'COLLISION' | 'DEATH' ] ). 68 @type multireact: int 69 @ivar reactshape: Power of reaction strength, dependent on distance to target. 70 @type reactshape: float 71 @ivar hairSegments: Amount of hair segments. 72 @type hairSegments: int 73 @ivar lifetime: Specify the life span of the particles. 74 @type lifetime: float 75 @ivar randlife: Give the particle life a random variation. 76 @type randlife: float 77 @ivar randemission: Emit particles in random order. 78 @type randemission: int 79 @ivar particleDistribution: Where to emit particles from ( Particle.EMITFROM[ 'PARTICLE' | 'VOLUME' | 'FACES' | 'VERTS' ] ) 80 @type particleDistribution: int 81 @ivar evenDistribution: Use even distribution from faces based on face areas or edge lengths. 82 @type evenDistribution: int 83 @ivar distribution: How to distribute particles on selected element ( Particle.DISTRIBUTION[ 'GRID' | 'RANDOM' | 'JITTERED' ] ). 84 @type distribution: int 85 @ivar jitterAmount: Amount of jitter applied to the sampling. 86 @type jitterAmount: float 87 @ivar pf: Emission locations / face (0 = automatic). 88 @type pf:int 89 @ivar invert: Invert what is considered object and what is not. 90 @type invert: int 91 @ivar targetObject: The object that has the target particle system (empty if same object). 92 @type targetObject: Blender object 93 @ivar targetpsys: The target particle system number in the object. 94 @type targetpsys: int 95 @ivar 2d: Constrain boids to a surface. 96 @type 2d: float 97 @ivar maxvel: Maximum velocity. 98 @type maxvel: float 99 @ivar avvel: The usual speed % of max velocity. 100 @type avvel: float 101 @ivar latacc: Lateral acceleration % of max velocity 102 @type latacc: float 103 @ivar tanacc: Tangential acceleration % of max velocity 104 @type tanacc: float 105 @ivar groundz: Default Z value. 106 @type groundz: float 107 @ivar object: Constrain boids to object's surface. 108 @type object: Blender Object 109 @ivar renderEmitter: Render emitter object. 110 @type renderEmitter: int 111 @ivar displayPercentage: Particle display percentage. 112 @type displayPercentage: int 113 @ivar hairDisplayStep: How many steps paths are drawn with (power of 2) in visu mode. 114 @type hairDisplayStep: int 115 @ivar hairRenderStep: How many steps paths are rendered with (power of 2) in render mode." 116 @type hairRenderStep: int 117 @ivar duplicateObject: Get the duplicate object. 118 @type duplicateObject: Blender Object 119 @ivar drawAs: Get draw type Particle.DRAWAS([ 'NONE' | 'OBJECT' | 'POINT' | ... ]). 120 @type drawAs: int 121 """ 122
123 - def freeEdit():
124 """ 125 Free edit mode. 126 @return: None 127 """
128
129 - def getLoc(all=0,id=0):
130 """ 131 Get the particles locations. 132 A list of tuple is returned in particle mode. 133 A list of list of tuple is returned in hair mode. 134 The tuple is a vector of 3 or 4 floats in world space (x,y,z, optionally the particle's id). 135 @type all: int 136 @param all: if not 0 export all particles (uninitialized (unborn or died)particles exported as None). 137 @type id: int 138 @param id: add the particle id in the end of the vector tuple 139 @rtype: list of vectors (tuple of 3 floats and optionally the id) or list of list of vectors 140 @return: list of vectors or list of list of vectors (hair mode) or None if system is disabled 141 """
142 - def getRot(all=0,id=0):
143 """ 144 Get the particles' rotations as quaternion. 145 A list of tuple is returned in particle mode. 146 The tuple is vector of 4 or 5 floats (x,y,z,w, optionally the id of the particle). 147 148 @type all: int 149 @param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None). 150 @type id: int 151 @param id: add the particle id in the return tuple 152 @rtype: list of tuple of 4 or 5 elements (if id is not zero) 153 @return: list of 4-tuples or None if system is disabled 154 """
155
156 - def getMat():
157 """ 158 Get the particles' material. 159 @rtype: Blender Material 160 @return: The material assigned to particles 161 """
162
163 - def getSize(all=0,id=0):
164 """ 165 Get the particles' size. 166 A list of float or list of tuple (particle's size,particle's id). 167 @type all: int 168 @param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None). 169 @type id: int 170 @param id: add the particle id in the return tuple 171 @rtype: list of floats 172 @return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled. 173 """
174
175 - def getAge(all=0,id=0):
176 """ 177 Get the particles' age. 178 A list of float or list of tuple (particle's age, particle's id). 179 @type all: int 180 @param all: if not 0, export all particles (uninitialized (unborn or died) particles exported as None). 181 @type id: int 182 @param id: add the particle id in the return tuple 183 @rtype: list of floats 184 @return: list of floats or list of tuples if id is not zero (size,id) or None if system is disabled. 185 """
186