| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  | # Blender.Effect module and the Effect PyType effect | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | """
 | 
					
						
							|  |  |  | The Blender.Effect submodule | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  | B{new}: now L{Get}('objname') (without specifying second parameter: 'position') returns a list of all effects linked to object "objname". | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  | Effect | 
					
						
							|  |  |  | ====== | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  | INTRODUCTION | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  | The Effect module allows you to access all the data of particle effects. | 
					
						
							|  |  |  | An effect can modify a mesh object using particles, where vertex of | 
					
						
							|  |  |  | the mesh emits particles, which can themselves emit new particles. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  | In the Blender internals, the effect object is just a placeholder for | 
					
						
							|  |  |  | the particle effect.  Prior to v2.39 build and wave effects were also | 
					
						
							|  |  |  | supported by Blender, and the Python API supported all three types of | 
					
						
							|  |  |  | effects.  They were removed in v2.39 when the build and wave modifiers | 
					
						
							|  |  |  | were implemented. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-22 00:27:03 +00:00
										 |  |  | Example:: | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   import Blender | 
					
						
							| 
									
										
										
										
											2006-08-09 01:37:17 +00:00
										 |  |  |     listffects = Blender.Effect.Get() | 
					
						
							|  |  |  |     print listeffects | 
					
						
							|  |  |  |     eff = listeffects[0] | 
					
						
							|  |  |  |     #we suppose the first effect is a build effect | 
					
						
							|  |  |  |     print eff.getLen() | 
					
						
							|  |  |  |     eff.setLen(500)	 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | @type Flags: read-only dictionary | 
					
						
							|  |  |  | @var Flags: The particle effect flags.  Values can be ORed. | 
					
						
							|  |  |  |   - SELECTED: The particle effect is selected in the UI. (Read-only) | 
					
						
							| 
									
										
										
										
											2005-11-17 19:19:05 +00:00
										 |  |  |   - BSPLINE: Use a B-spline formula for particle interpolation | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |   - STATIC: Make static particles | 
					
						
							|  |  |  |   - ANIMATED: Recalculate static particles for each rendered frame | 
					
						
							| 
									
										
										
										
											2005-11-17 19:19:05 +00:00
										 |  |  |   - VERTS: Emit particles from vertices | 
					
						
							|  |  |  |   - FACES: Emit particles from faces | 
					
						
							|  |  |  |   - EVENDIST: Use even distribution based on face area (requires FACES) | 
					
						
							|  |  |  |   - TRUERAND: Use true random distribution based on face area (requires FACES) | 
					
						
							|  |  |  |   - UNBORN: Make particles appear before they are emitted | 
					
						
							|  |  |  |   - DIED: Make particles appear after they have died | 
					
						
							|  |  |  |   - EMESH: Render emitter mesh | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | @type SpeedTypes: read-only dictionary | 
					
						
							|  |  |  | @var SpeedTypes: The available settings for selecting particle speed vectors. | 
					
						
							|  |  |  | Only one setting is active at a time. | 
					
						
							|  |  |  |   - INTENSITY: Use texture intensity | 
					
						
							|  |  |  |   - RGB: Use RGB values | 
					
						
							|  |  |  |   - GRADIENT: Use texture gradient | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  | """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  | def New (name): | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |   Creates a new particle effect and attaches to an object. | 
					
						
							|  |  |  |   @type name: string | 
					
						
							|  |  |  |   @param name: The name of object to associate with the effect.  Only mesh | 
					
						
							|  |  |  |    objects are supported. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   @rtype: Blender Effect | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |   @return: the new effect | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  | def Get (name = None, position = None): | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   """
 | 
					
						
							|  |  |  |   Get an Effect from Blender. | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |   @type name: string | 
					
						
							|  |  |  |   @param name: The name of object linked to the effect. | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  |   @type position: int | 
					
						
							|  |  |  |   @param position: The position of the effect in the list of effects linked to the object. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   @rtype: Blender Effect or a list of Blender Effects | 
					
						
							| 
									
										
											  
											
												BPython -- a few fixes:
-- fixed bug #1689:
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1689&group_id=9
Reported by Tom Musgrove (thanks), the problem was that Window.QHandle was not passing events to windows that had id's below the current active window.  It was a stupid mistake (mine), the code was iterating from curarea instead of from the first area in the areabase list.
-- fixed bug #1568:
http://projects.blender.org/tracker/index.php?func=detail&aid=1568&group_id=9&atid=125
Stephen investigated the problem, reported by Gabriel Beloin, and left hints in the bug report, thanks :).  I also implemented what he suggested, now Effect.Get('objname') returns a list with all objname's effects and as before, Get('objname, position') returns the effect at position 'position'.  Ref doc already updated.
-- Allowed menu registration lines to appear commented out -- Python comments: '#', of course -- (suggested by Michael Reimpell) in scripts:
Some Python doc tools need the doc strings between triple double-quotes, so to avoid conflicts scripts writers can now comment out the registration code, it should work anyway.  Michael also provided a patch for this a few days ago, too (thanks), but to keep changes at a minimum because of proximity to a release I didn't use it.
											
										 
											2004-10-31 04:09:19 +00:00
										 |  |  |   @return: It depends on the 'objname, position' parameters: | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |       - ():     A list with all Effects in the current scene; | 
					
						
							|  |  |  |       - (name): A list with all Effects linked to the given object; | 
					
						
							|  |  |  |       - (name, position): The Effect linked to the given object at the given position | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  | class Effect: | 
					
						
							|  |  |  |   """
 | 
					
						
							|  |  |  |   The Effect object | 
					
						
							|  |  |  |   ================= | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |   This object gives access to particle effect data in Blender. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   @ivar child: The number of children a particle may have. | 
					
						
							|  |  |  |     Values are clamped to the range [1,600]. | 
					
						
							|  |  |  |   @type child: tuple of 4 ints | 
					
						
							| 
									
										
										
										
											2005-11-17 19:19:05 +00:00
										 |  |  |   @ivar childMat: The materials used by the 4 generation particles. | 
					
						
							|  |  |  |     Values are clamped to the range [1,16]. | 
					
						
							|  |  |  |   @type childMat: tuple of 4 ints | 
					
						
							|  |  |  |   @ivar damping: The particle damping factor.  This controls the rate at | 
					
						
							|  |  |  |     which particles decelerate. | 
					
						
							|  |  |  |     Values are clamped to the range [0.0,1.0]. | 
					
						
							|  |  |  |   @type damping: float | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |   @ivar defvec: The x, y and z axis of the force defined by the texture. | 
					
						
							|  |  |  |     Values are clamped to the range [-1.0,1.0]. | 
					
						
							|  |  |  |   @type defvec: tuple of 3 floats | 
					
						
							| 
									
										
										
										
											2006-08-17 21:39:49 +00:00
										 |  |  |   @ivar disp: The percentage of particles displayed. | 
					
						
							|  |  |  |     Value is clamped to the range [0,100]. | 
					
						
							|  |  |  |   @type disp: int | 
					
						
							| 
									
										
										
										
											2005-11-17 19:19:05 +00:00
										 |  |  |   @ivar dispMat: The material used for the particles. | 
					
						
							|  |  |  |     Value is clamped to the range [1,16]. | 
					
						
							|  |  |  |   @type dispMat: int | 
					
						
							|  |  |  |   @ivar emissionTex: The texture used for texture emission. | 
					
						
							|  |  |  |     Value is clamped to the range [1,10]. | 
					
						
							|  |  |  |   @type emissionTex: int | 
					
						
							| 
									
										
										
										
											2005-11-20 15:12:06 +00:00
										 |  |  |   @ivar end: The end time of the effect. | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Value is clamped to the range [1.0,30000.0]. | 
					
						
							|  |  |  |   @type end: float | 
					
						
							|  |  |  |   @ivar flag: The flag bitfield.  See L{Flags} for values. | 
					
						
							|  |  |  |   @type flag: int | 
					
						
							|  |  |  |   @ivar force: The constant force applied to the parts. | 
					
						
							|  |  |  |     Values are clamped to the range [-1.0,1.0]. | 
					
						
							|  |  |  |   @type force: tuple of 3 floats | 
					
						
							| 
									
										
										
										
											2005-11-17 19:19:05 +00:00
										 |  |  |   @ivar forceTex: The texture used for force. | 
					
						
							|  |  |  |     Value is clamped to the range [1,10]. | 
					
						
							|  |  |  |   @type forceTex: int | 
					
						
							|  |  |  |   @ivar jitter: Jitter table distribution: maximum particles per face. | 
					
						
							|  |  |  |     Values are clamped to the range [0,200]. | 
					
						
							|  |  |  |   @type jitter: int | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |   @ivar life: The lifetime of of the next generation of particles. | 
					
						
							|  |  |  |     Values are clamped to the range [1.0,30000.0]. | 
					
						
							|  |  |  |   @type life: tuple of 4 floats | 
					
						
							|  |  |  |   @ivar lifetime: The lifetime of the effect. | 
					
						
							|  |  |  |     Value is clamped to the range [1.0,30000.0]. | 
					
						
							|  |  |  |   @type lifetime: float | 
					
						
							|  |  |  |   @ivar mult: The probabilities of a particle having a child. | 
					
						
							|  |  |  |     Values are clamped to the range [0.0,1.0]. | 
					
						
							|  |  |  |   @type mult: tuple of 4 floats | 
					
						
							|  |  |  |   @ivar nabla: The nabla value. | 
					
						
							|  |  |  |     Value is clamped to the range [0.0001,1.0]. | 
					
						
							|  |  |  |   @type nabla: float | 
					
						
							|  |  |  |   @ivar normfac: The normal strength of the particles relative to mesh. | 
					
						
							|  |  |  |     Value is clamped to the range [-2.0,2.0]. | 
					
						
							|  |  |  |   @type normfac: float | 
					
						
							|  |  |  |   @ivar obfac: The strength of the particles relative to objects. | 
					
						
							|  |  |  |     Value is clamped to the range [-1.0,1.0]. | 
					
						
							|  |  |  |   @type obfac: float | 
					
						
							|  |  |  |   @ivar randfac: The initial random speed of the particles. | 
					
						
							|  |  |  |     Value is clamped to the range [0.0,2.0]. | 
					
						
							|  |  |  |   @type randfac: float | 
					
						
							|  |  |  |   @ivar randlife: The variability of the life of the particles. | 
					
						
							|  |  |  |     Value is clamped to the range [0.0,2.0]. | 
					
						
							|  |  |  |   @type randlife: float | 
					
						
							|  |  |  |   @ivar seed: The seed of the random number generator. | 
					
						
							|  |  |  |     Value is clamped to the range [0,255]. | 
					
						
							|  |  |  |   @type seed: int | 
					
						
							| 
									
										
										
										
											2005-11-17 19:19:05 +00:00
										 |  |  |   @ivar speedType: Controls which texture property affects particle speeds. | 
					
						
							|  |  |  |     See L{SpeedTypes} for values and their meanings. | 
					
						
							|  |  |  |   @type speedType: int | 
					
						
							|  |  |  |   @ivar speedVGroup: The name of the vertex group used for speed control. | 
					
						
							|  |  |  |   @type speedVGroup: str | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |   @ivar sta: The start time of the effect. | 
					
						
							|  |  |  |     Value is clamped to the range [-250.0,30000.0]. | 
					
						
							|  |  |  |   @type sta: float | 
					
						
							| 
									
										
										
										
											2006-08-17 21:39:49 +00:00
										 |  |  |   @ivar staticStep: percentage of skipped particles in static display. | 
					
						
							|  |  |  |     Value is clamped to the range [1,100]. | 
					
						
							|  |  |  |   @type staticStep: int   | 
					
						
							|  |  |  |   @ivar stype: The bitfield for vector. | 
					
						
							|  |  |  |   @type stype: int | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |   @ivar texfac: The initial speed of the particles caused by the texture. | 
					
						
							|  |  |  |     Value is clamped to the range [0.0,2.0]. | 
					
						
							|  |  |  |   @type texfac: float | 
					
						
							|  |  |  |   @ivar totpart: The total number of particles. | 
					
						
							|  |  |  |     Value is clamped to the range [1,100000]. | 
					
						
							|  |  |  |   @type totpart: int | 
					
						
							|  |  |  |   @ivar totkey: The total number of key positions. | 
					
						
							|  |  |  |     Value is clamped to the range [1,100]. | 
					
						
							|  |  |  |   @type totkey: int | 
					
						
							|  |  |  |   @ivar type: The type of the effect.  Deprecated. | 
					
						
							|  |  |  |   @type type: int | 
					
						
							|  |  |  |   @ivar vectsize: The size of vectors associated to the particles (if any). | 
					
						
							|  |  |  |     Value is clamped to the range [0.0,1.0]. | 
					
						
							|  |  |  |   @type vectsize: float | 
					
						
							| 
									
										
										
										
											2005-11-17 19:19:05 +00:00
										 |  |  |   @ivar vGroup: The name of the vertex group used for emitted particles. | 
					
						
							|  |  |  |   @type vGroup: str | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getType(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the type of an effect object. | 
					
						
							|  |  |  |     Deprecated, since only particle effects are supported. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: int  | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     @return:  the type of an effect object : should always return 1 | 
					
						
							|  |  |  |     (particle effect) | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setType(name): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Deprecated, since only particle effects are supported. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type name: int | 
					
						
							|  |  |  |     @param name : the new type.  | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getFlag(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2004-08-04 20:52:55 +00:00
										 |  |  |     Retrieves the flag of an effect object.  The flag is a bit-mask. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: int  | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     @return:  The flag of the effect is a combination of parameters.  See | 
					
						
							|  |  |  |       L{Flags} for values. | 
					
						
							| 
									
										
										
										
											2004-08-04 20:52:55 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setFlag(newflag): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the flag of an effect object. See L{Flags} for values. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newflag: int | 
					
						
							|  |  |  |     @param newflag: the new flag.  | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |   def getStartTime(): | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the starting time of a particle effect object | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: float | 
					
						
							|  |  |  |     @return:  the starting time of the effect. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setSta(newstart): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the starting time of an particle effect object | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newstart: float | 
					
						
							|  |  |  |     @param newstart: the new starting time.  | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |   def getEndTime(): | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the end time of a particle effect object | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: float  | 
					
						
							|  |  |  |     @return:  the end time of the effect. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setEnd(newendrt): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the end time of an particle effect object | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newendrt: float | 
					
						
							|  |  |  |     @param newendrt: the new end time.  | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2006-08-09 01:37:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   def getLifetime(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the lifetime of a particle effect object | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: float  | 
					
						
							|  |  |  |     @return:  the lifetime of the effect. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  |   def setLifetime(newlifetime): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the lifetime of a particle effect object | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newlifetime: float | 
					
						
							|  |  |  |     @param newlifetime: the new lifetime.  | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getNormfac(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the  normal strength of the particles (relatively to mesh). | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: float  | 
					
						
							|  |  |  |     @return:  normal strength of the particles (relatively to mesh). | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setNormfac(newnormfac): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the normal strength of the particles (relatively to mesh). | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newnormfac: float | 
					
						
							|  |  |  |     @param newnormfac: the normal strength of the particles (relatively to mesh).  | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2006-08-09 01:37:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   def getObfac(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the initial strength of the particles relatively to objects. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: float  | 
					
						
							|  |  |  |     @return: initial strength of the particles (relatively to mesh). | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setObfac(newobfac): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the initial strength of the particles relatively to objects. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newobfac: float | 
					
						
							|  |  |  |     @param newobfac: the initial strength of the particles relatively to objects. | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getRandfac(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the random  strength applied to the particles. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: float  | 
					
						
							|  |  |  |     @return: random  strength applied to the particles. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setRandfac(newrandfac): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the random  strength applied to the particles.  | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newrandfac: float | 
					
						
							|  |  |  |     @param newrandfac: the random  strength applied to the particles. | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2006-08-09 01:37:17 +00:00
										 |  |  |      | 
					
						
							|  |  |  |   def getStype(): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     Retrieves the vect state of an effect object. | 
					
						
							|  |  |  |     @rtype: int  | 
					
						
							|  |  |  |     @return:  the Stype (Vect) of an effect object : 0 , Vect is not enabled, 1, Vect is enabled  | 
					
						
							|  |  |  |     (particle effect) | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setStype(int): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     @type int : int | 
					
						
							|  |  |  |     @param int : state of the Stype : 0 not enabled, 1 enabled.  | 
					
						
							|  |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   def getTexfac(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the strength applied to the particles from the texture of the object. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: float  | 
					
						
							|  |  |  |     @return: strength applied to the particles from the texture of the object. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setTexfac(newtexfac): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the strength applied to the particles from the texture of the object.  | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newtexfac: float | 
					
						
							|  |  |  |     @param newtexfac: the strength applied to the particles from the texture of the object. | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getRandlife(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the  variability of the life of the particles. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: float  | 
					
						
							|  |  |  |     @return: variability of the life of the particles. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setRandlife(newrandlife): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the variability of the life of the particles. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newrandlife: float | 
					
						
							|  |  |  |     @param newrandlife: the variability of the life of the particles. | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getNabla(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the sensibility of the particles to the variations of the texture. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: float  | 
					
						
							| 
									
										
										
										
											2004-08-04 20:52:55 +00:00
										 |  |  |     @return: sensibility of the particles to the variations of the texture. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  |   def setNabla(newnabla): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the sensibility of the particles to the variations of the texture. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newnabla: float | 
					
						
							| 
									
										
										
										
											2004-08-04 20:52:55 +00:00
										 |  |  |     @param newnabla: the sensibility of the particles to the variations of the texture. | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getVectsize(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the size of the vector which is associated to the particles. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: float  | 
					
						
							|  |  |  |     @return: size of the vector which is associated to the particles. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  |   def setVectsize(newvectsize): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the size of the vector which is associated to the particles. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newvectsize: float | 
					
						
							|  |  |  |     @param newvectsize: the size of the vector which is associated to the particles. | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getTotpart(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the total number of particles. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: int  | 
					
						
							|  |  |  |     @return: the total number of particles. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  |   def setTotpart(newtotpart): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the the total number of particles. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newtotpart: int | 
					
						
							|  |  |  |     @param newtotpart: the the total number of particles. | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getTotkey(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the number of keys associated to the particles (kind of degree of freedom) | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: int  | 
					
						
							|  |  |  |     @return: number of keys associated to the particles. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setTotkey(newtotkey): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the number of keys associated to the particles. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newtotkey: int | 
					
						
							|  |  |  |     @param newtotkey: number of keys associated to the particles. | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getSeed(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the random number generator seed. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @rtype: int  | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     @return:  current seed value. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setSeed(newseed): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the  random number generator seed. | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @type newseed: int | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     @param newseed:  new seed value. | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getForce(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the force applied to the particles. | 
					
						
							|  |  |  |     @rtype: tuple of three floats  | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @return:   force applied to the particles. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setForce(newforce): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the force applied to the particles. | 
					
						
							|  |  |  |     @type newforce: tuple of 3 floats | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @param newforce:  force applied to the particles. | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getMult(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the probabilities of a particle having a child. | 
					
						
							|  |  |  |     @rtype: tuple of 4 floats  | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @return:  probabilities of a particle having a child. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def setMult(newmult): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the probabilities of a particle having a child. | 
					
						
							|  |  |  |     @type newmult: tuple of 4 floats | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @param newmult:  probabilities of a particle having a child. | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2006-08-09 01:37:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   def getLife(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the average life of the particles (4 generations) | 
					
						
							|  |  |  |     @rtype: tuple of 4 floats  | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @return: average life of the particles (4 generations) | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2006-08-09 01:37:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   def setLife(newlife): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the average life of the particles (4 generations). | 
					
						
							|  |  |  |     @type newlife: tuple of 4 floats | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @param newlife:  average life of the particles (4 generations). | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2006-08-09 01:37:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   def getChild(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the average number of children of the particles (4 generations). | 
					
						
							|  |  |  |     @rtype: tuple of 4 ints  | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @return: average number of children of the particles (4 generations). | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2006-08-09 01:37:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   def setChild(newchild): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the average number of children of the particles (4 generations). | 
					
						
							|  |  |  |     @type newchild: tuple of 4 ints | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @param newchild:  average number of children of the particles (4 generations). | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getMat(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the indexes of the materials associated to the particles (4 generations). | 
					
						
							|  |  |  |     @rtype: tuple of 4 ints  | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @return: indexes of the materials associated to the particles (4 generations). | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2006-08-09 01:37:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   def setMat(newmat): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the indexes of the materials associated to the particles (4 generations). | 
					
						
							|  |  |  |     @type newmat: tuple of 4 ints | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @param newmat:   the indexes of the materials associated to the particles (4 generations). | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   def getDefvec(): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Retrieves the x, y and z components of the force defined by the texture. | 
					
						
							|  |  |  |     @rtype: tuple of 3 floats  | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     @return: x, y and z components of the force defined by the texture. | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2006-08-09 01:37:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |   def setDefvec(newdefvec): | 
					
						
							|  |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  |     Sets the x, y and z components of the force defined by the texture. | 
					
						
							|  |  |  |     @type newdefvec: tuple of 3 floats | 
					
						
							| 
									
										
										
										
											2005-11-17 19:19:05 +00:00
										 |  |  |     @param newdefvec:   the x, y and z components of the force defined by the | 
					
						
							|  |  |  |     texture. | 
					
						
							| 
									
										
										
										
											2006-07-12 01:36:07 +00:00
										 |  |  |     @rtype: None | 
					
						
							|  |  |  |     @return:  None | 
					
						
							| 
									
										
										
										
											2003-07-12 14:35:49 +00:00
										 |  |  |     """
 | 
					
						
							| 
									
										
										
										
											2005-11-07 00:22:05 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-08-09 01:37:17 +00:00
										 |  |  |   def getParticlesLoc(): | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     Gets the location of each particle at the current time in worldspace. | 
					
						
							|  |  |  |     @rtype: A list of vector or a list of vector lists. | 
					
						
							|  |  |  |     @return: The coordinates of each particle at the current time. | 
					
						
							|  |  |  |     If the "Vect" option is enabled a list Vector pairs will be returned with a start and end point for each particle. | 
					
						
							|  |  |  |     When static particles are enabled, a list of lists will be returned, each item a strand of particles. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Example:: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |           import Blender | 
					
						
							|  |  |  |           from Blender import Effect, Object | 
					
						
							|  |  |  |           scn= Blender.Scene.GetCurrent() | 
					
						
							|  |  |  |           ob= scn.getActiveObject() | 
					
						
							|  |  |  |           effect= ob.effects[0] | 
					
						
							|  |  |  |           particles= effect.getParticlesLoc() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |           # Check that particles are points only (not static and not vectors) | 
					
						
							|  |  |  |           if not effect.getFlag() & Effect.Flags.STATIC or not effect.getStype(): | 
					
						
							|  |  |  |             for pt in particles:  | 
					
						
							|  |  |  |               ob_empty= Object.New('Empty') | 
					
						
							|  |  |  |               ob_empty.setLocation(pt) | 
					
						
							|  |  |  |               scn.link(ob_empty) | 
					
						
							|  |  |  |            | 
					
						
							|  |  |  |           else: # Particles will be a list | 
					
						
							|  |  |  |             for pt in particles: | 
					
						
							|  |  |  |               for pt_item in pt: | 
					
						
							|  |  |  |                 ob_empty= Object.New('Empty') | 
					
						
							|  |  |  |                 ob_empty.setLocation(pt_item) | 
					
						
							|  |  |  |                 scn.link(ob_empty) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     Example:: | 
					
						
							|  |  |  |           # Converts particles into a mesh with edges for strands | 
					
						
							|  |  |  |           from Blender import Scene, Mathutils, Effect, Mesh, Object | 
					
						
							|  |  |  |           scn= Scene.GetCurrent() | 
					
						
							|  |  |  |           ob= scn.getActiveObject() | 
					
						
							|  |  |  |           me= Mesh.New() | 
					
						
							|  |  |  |            | 
					
						
							|  |  |  |           effects= Effect.Get() | 
					
						
							|  |  |  |           for eff in effects: | 
					
						
							| 
									
										
										
										
											2006-08-09 01:53:34 +00:00
										 |  |  |               for p in eff.getParticlesLoc(): | 
					
						
							|  |  |  |                   # p is either a vector or a list of vectors. me.verts.extend() will deal with either | 
					
						
							| 
									
										
										
										
											2006-08-09 01:37:17 +00:00
										 |  |  |                   print p | 
					
						
							|  |  |  |                   me.verts.extend(p) | 
					
						
							|  |  |  |            | 
					
						
							|  |  |  |                   if type(p)==list: # Are we a strand or a pair, then add edges. | 
					
						
							|  |  |  |                       if len(p)>1: | 
					
						
							|  |  |  |                           edges= [(i, i+1) for i in range(len(me.verts)-len(p), len(me.verts)-1)] | 
					
						
							|  |  |  |                           me.edges.extend( edges ) | 
					
						
							|  |  |  |            | 
					
						
							|  |  |  |           print len(me.verts) | 
					
						
							|  |  |  |           ob= Object.New('Mesh') | 
					
						
							|  |  |  |           ob.link(me) | 
					
						
							|  |  |  |           scn.link(ob) | 
					
						
							| 
									
										
										
										
											2005-11-20 15:12:06 +00:00
										 |  |  |     """
 |