Module Effect :: Class Effect
[frames | no frames]

Class Effect


The Effect object

This object gives access to particle effect data in Blender.
Method Summary
tuple of 4 ints getChild()
Retrieves the average number of children of the particles (4 generations).
tuple of 3 floats getDefvec()
Retrieves the x, y and z components of the force defined by the texture.
float getEndTime()
Retrieves the end time of a particle effect object
int getFlag()
Retrieves the flag of an effect object.
tuple of three floats getForce()
Retrieves the force applied to the particles.
tuple of 4 floats getLife()
Retrieves the average life of the particles (4 generations)
float getLifetime()
Retrieves the lifetime of a particle effect object
tuple of 4 ints getMat()
Retrieves the indexes of the materials associated to the particles (4 generations).
tuple of 4 floats getMult()
Retrieves the probabilities of a particle having a child.
float getNabla()
Retrieves the sensibility of the particles to the variations of the texture.
float getNormfac()
Retrieves the normal strength of the particles (relatively to mesh).
float getObfac()
Retrieves the initial strength of the particles relatively to objects.
A list of vector or a list of vector lists. getParticlesLoc()
Gets the location of each particle at the current time in worldspace.
float getRandfac()
Retrieves the random strength applied to the particles.
float getRandlife()
Retrieves the variability of the life of the particles.
int getSeed()
Retrieves the random number generator seed.
float getStartTime()
Retrieves the starting time of a particle effect object
int getStype()
Retrieves the vect state of an effect object.
float getTexfac()
Retrieves the strength applied to the particles from the texture of the object.
int getTotkey()
Retrieves the number of keys associated to the particles (kind of degree of freedom)
int getTotpart()
Retrieves the total number of particles.
int getType()
Retrieves the type of an effect object.
float getVectsize()
Retrieves the size of the vector which is associated to the particles.
None setChild(newchild)
Sets the average number of children of the particles (4 generations).
None setDefvec(newdefvec)
Sets the x, y and z components of the force defined by the texture.
None setEnd(newendrt)
Sets the end time of an particle effect object
None setFlag(newflag)
Sets the flag of an effect object.
None setForce(newforce)
Sets the force applied to the particles.
None setLife(newlife)
Sets the average life of the particles (4 generations).
None setLifetime(newlifetime)
Sets the lifetime of a particle effect object
None setMat(newmat)
Sets the indexes of the materials associated to the particles (4 generations).
None setMult(newmult)
Sets the probabilities of a particle having a child.
None setNabla(newnabla)
Sets the sensibility of the particles to the variations of the texture.
None setNormfac(newnormfac)
Sets the normal strength of the particles (relatively to mesh).
None setObfac(newobfac)
Sets the initial strength of the particles relatively to objects.
None setRandfac(newrandfac)
Sets the random strength applied to the particles.
None setRandlife(newrandlife)
Sets the variability of the life of the particles.
None setSeed(newseed)
Sets the random number generator seed.
None setSta(newstart)
Sets the starting time of an particle effect object
None setStype(int)
Return none
None setTexfac(newtexfac)
Sets the strength applied to the particles from the texture of the object.
None setTotkey(newtotkey)
Sets the number of keys associated to the particles.
None setTotpart(newtotpart)
Sets the the total number of particles.
None setType(name)
Deprecated, since only particle effects are supported.
None setVectsize(newvectsize)
Sets the size of the vector which is associated to the particles.

Instance Variable Summary
tuple of 4 ints child: The number of children a particle may have.
tuple of 4 ints childMat: The materials used by the 4 generation particles.
float damping: The particle damping factor.
tuple of 3 floats defvec: The x, y and z axis of the force defined by the texture.
int disp: The percentage of particles displayed.
int dispMat: The material used for the particles.
int emissionTex: The texture used for texture emission.
float end: The end time of the effect.
int flag: The flag bitfield.
tuple of 3 floats force: The constant force applied to the parts.
int forceTex: The texture used for force.
int jitter: Jitter table distribution: maximum particles per face.
tuple of 4 floats life: The lifetime of of the next generation of particles.
float lifetime: The lifetime of the effect.
tuple of 4 floats mult: The probabilities of a particle having a child.
float nabla: The nabla value.
float normfac: The normal strength of the particles relative to mesh.
float obfac: The strength of the particles relative to objects.
float randfac: The initial random speed of the particles.
float randlife: The variability of the life of the particles.
int seed: The seed of the random number generator.
int speedType: Controls which texture property affects particle speeds.
str speedVGroup: The name of the vertex group used for speed control.
float sta: The start time of the effect.
int staticStep: percentage of skipped particles in static display.
int stype: The bitfield for vector.
float texfac: The initial speed of the particles caused by the texture.
int totkey: The total number of key positions.
int totpart: The total number of particles.
int type: The type of the effect.
float vectsize: The size of vectors associated to the particles (if any).
str vGroup: The name of the vertex group used for emitted particles.

Method Details

getChild()

Retrieves the average number of children of the particles (4 generations).
Returns:
average number of children of the particles (4 generations).
           (type=tuple of 4 ints)

getDefvec()

Retrieves the x, y and z components of the force defined by the texture.
Returns:
x, y and z components of the force defined by the texture.
           (type=tuple of 3 floats)

getEndTime()

Retrieves the end time of a particle effect object
Returns:
the end time of the effect.
           (type=float)

getFlag()

Retrieves the flag of an effect object. The flag is a bit-mask.
Returns:
The flag of the effect is a combination of parameters. See Flags for values.
           (type=int)

getForce()

Retrieves the force applied to the particles.
Returns:
force applied to the particles.
           (type=tuple of three floats)

getLife()

Retrieves the average life of the particles (4 generations)
Returns:
average life of the particles (4 generations)
           (type=tuple of 4 floats)

getLifetime()

Retrieves the lifetime of a particle effect object
Returns:
the lifetime of the effect.
           (type=float)

getMat()

Retrieves the indexes of the materials associated to the particles (4 generations).
Returns:
indexes of the materials associated to the particles (4 generations).
           (type=tuple of 4 ints)

getMult()

Retrieves the probabilities of a particle having a child.
Returns:
probabilities of a particle having a child.
           (type=tuple of 4 floats)

getNabla()

Retrieves the sensibility of the particles to the variations of the texture.
Returns:
sensibility of the particles to the variations of the texture.
           (type=float)

getNormfac()

Retrieves the normal strength of the particles (relatively to mesh).
Returns:
normal strength of the particles (relatively to mesh).
           (type=float)

getObfac()

Retrieves the initial strength of the particles relatively to objects.
Returns:
initial strength of the particles (relatively to mesh).
           (type=float)

getParticlesLoc()

Gets the location of each particle at the current time in worldspace.
Returns:

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= scn.objects.new('Empty')
         ob_empty.setLocation(pt)
     
     else: # Particles will be a list
       for pt in particles:
         for pt_item in pt:
           ob_empty= scn.objects.new('Empty')
           ob_empty.setLocation(pt_item)
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:
         for p in eff.getParticlesLoc():
             # p is either a vector or a list of vectors. me.verts.extend() will deal with either
             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= scn.objects.new(me)

           (type=A list of vector or a list of vector lists.)

getRandfac()

Retrieves the random strength applied to the particles.
Returns:
random strength applied to the particles.
           (type=float)

getRandlife()

Retrieves the variability of the life of the particles.
Returns:
variability of the life of the particles.
           (type=float)

getSeed()

Retrieves the random number generator seed.
Returns:
current seed value.
           (type=int)

getStartTime()

Retrieves the starting time of a particle effect object
Returns:
the starting time of the effect.
           (type=float)

getStype()

Retrieves the vect state of an effect object.
Returns:
the Stype (Vect) of an effect object : 0 , Vect is not enabled, 1, Vect is enabled (particle effect)
           (type=int)

getTexfac()

Retrieves the strength applied to the particles from the texture of the object.
Returns:
strength applied to the particles from the texture of the object.
           (type=float)

getTotkey()

Retrieves the number of keys associated to the particles (kind of degree of freedom)
Returns:
number of keys associated to the particles.
           (type=int)

getTotpart()

Retrieves the total number of particles.
Returns:
the total number of particles.
           (type=int)

getType()

Retrieves the type of an effect object. Deprecated, since only particle effects are supported.
Returns:
the type of an effect object : should always return 1 (particle effect)
           (type=int)

getVectsize()

Retrieves the size of the vector which is associated to the particles.
Returns:
size of the vector which is associated to the particles.
           (type=float)

setChild(newchild)

Sets the average number of children of the particles (4 generations).
Parameters:
newchild - average number of children of the particles (4 generations).
           (type=tuple of 4 ints)
Returns:
None
           (type=None)

setDefvec(newdefvec)

Sets the x, y and z components of the force defined by the texture.
Parameters:
newdefvec - the x, y and z components of the force defined by the texture.
           (type=tuple of 3 floats)
Returns:
None
           (type=None)

setEnd(newendrt)

Sets the end time of an particle effect object
Parameters:
newendrt - the new end time.
           (type=float)
Returns:
None
           (type=None)

setFlag(newflag)

Sets the flag of an effect object. See Flags for values.
Parameters:
newflag - the new flag.
           (type=int)
Returns:
None
           (type=None)

setForce(newforce)

Sets the force applied to the particles.
Parameters:
newforce - force applied to the particles.
           (type=tuple of 3 floats)
Returns:
None
           (type=None)

setLife(newlife)

Sets the average life of the particles (4 generations).
Parameters:
newlife - average life of the particles (4 generations).
           (type=tuple of 4 floats)
Returns:
None
           (type=None)

setLifetime(newlifetime)

Sets the lifetime of a particle effect object
Parameters:
newlifetime - the new lifetime.
           (type=float)
Returns:
None
           (type=None)

setMat(newmat)

Sets the indexes of the materials associated to the particles (4 generations).
Parameters:
newmat - the indexes of the materials associated to the particles (4 generations).
           (type=tuple of 4 ints)
Returns:
None
           (type=None)

setMult(newmult)

Sets the probabilities of a particle having a child.
Parameters:
newmult - probabilities of a particle having a child.
           (type=tuple of 4 floats)
Returns:
None
           (type=None)

setNabla(newnabla)

Sets the sensibility of the particles to the variations of the texture.
Parameters:
newnabla - the sensibility of the particles to the variations of the texture.
           (type=float)
Returns:
None
           (type=None)

setNormfac(newnormfac)

Sets the normal strength of the particles (relatively to mesh).
Parameters:
newnormfac - the normal strength of the particles (relatively to mesh).
           (type=float)
Returns:
None
           (type=None)

setObfac(newobfac)

Sets the initial strength of the particles relatively to objects.
Parameters:
newobfac - the initial strength of the particles relatively to objects.
           (type=float)
Returns:
None
           (type=None)

setRandfac(newrandfac)

Sets the random strength applied to the particles.
Parameters:
newrandfac - the random strength applied to the particles.
           (type=float)
Returns:
None
           (type=None)

setRandlife(newrandlife)

Sets the variability of the life of the particles.
Parameters:
newrandlife - the variability of the life of the particles.
           (type=float)
Returns:
None
           (type=None)

setSeed(newseed)

Sets the random number generator seed.
Parameters:
newseed - new seed value.
           (type=int)
Returns:
None
           (type=None)

setSta(newstart)

Sets the starting time of an particle effect object
Parameters:
newstart - the new starting time.
           (type=float)
Returns:
None
           (type=None)

setStype(int)

Parameters:
int - state of the Stype : 0 not enabled, 1 enabled.
           (type=int)
Returns:
None
           (type=None)

setTexfac(newtexfac)

Sets the strength applied to the particles from the texture of the object.
Parameters:
newtexfac - the strength applied to the particles from the texture of the object.
           (type=float)
Returns:
None
           (type=None)

setTotkey(newtotkey)

Sets the number of keys associated to the particles.
Parameters:
newtotkey - number of keys associated to the particles.
           (type=int)
Returns:
None
           (type=None)

setTotpart(newtotpart)

Sets the the total number of particles.
Parameters:
newtotpart - the the total number of particles.
           (type=int)
Returns:
None
           (type=None)

setType(name)

Deprecated, since only particle effects are supported.
Parameters:
name - the new type.
           (type=int)
Returns:
None
           (type=None)

setVectsize(newvectsize)

Sets the size of the vector which is associated to the particles.
Parameters:
newvectsize - the size of the vector which is associated to the particles.
           (type=float)
Returns:
None
           (type=None)

Instance Variable Details

child

The number of children a particle may have. Values are clamped to the range [1,600].
Type:
tuple of 4 ints

childMat

The materials used by the 4 generation particles. Values are clamped to the range [1,16].
Type:
tuple of 4 ints

damping

The particle damping factor. This controls the rate at which particles decelerate. Values are clamped to the range [0.0,1.0].
Type:
float

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:
tuple of 3 floats

disp

The percentage of particles displayed. Value is clamped to the range [0,100].
Type:
int

dispMat

The material used for the particles. Value is clamped to the range [1,16].
Type:
int

emissionTex

The texture used for texture emission. Value is clamped to the range [1,10].
Type:
int

end

The end time of the effect. Value is clamped to the range [1.0,30000.0].
Type:
float

flag

The flag bitfield. See Flags for values.
Type:
int

force

The constant force applied to the parts. Values are clamped to the range [-1.0,1.0].
Type:
tuple of 3 floats

forceTex

The texture used for force. Value is clamped to the range [1,10].
Type:
int

jitter

Jitter table distribution: maximum particles per face. Values are clamped to the range [0,200].
Type:
int

life

The lifetime of of the next generation of particles. Values are clamped to the range [1.0,30000.0].
Type:
tuple of 4 floats

lifetime

The lifetime of the effect. Value is clamped to the range [1.0,30000.0].
Type:
float

mult

The probabilities of a particle having a child. Values are clamped to the range [0.0,1.0].
Type:
tuple of 4 floats

nabla

The nabla value. Value is clamped to the range [0.0001,1.0].
Type:
float

normfac

The normal strength of the particles relative to mesh. Value is clamped to the range [-2.0,2.0].
Type:
float

obfac

The strength of the particles relative to objects. Value is clamped to the range [-1.0,1.0].
Type:
float

randfac

The initial random speed of the particles. Value is clamped to the range [0.0,2.0].
Type:
float

randlife

The variability of the life of the particles. Value is clamped to the range [0.0,2.0].
Type:
float

seed

The seed of the random number generator. Value is clamped to the range [0,255].
Type:
int

speedType

Controls which texture property affects particle speeds. See SpeedTypes for values and their meanings.
Type:
int

speedVGroup

The name of the vertex group used for speed control.
Type:
str

sta

The start time of the effect. Value is clamped to the range [-250.0,30000.0].
Type:
float

staticStep

percentage of skipped particles in static display. Value is clamped to the range [1,100].
Type:
int

stype

The bitfield for vector.
Type:
int

texfac

The initial speed of the particles caused by the texture. Value is clamped to the range [0.0,2.0].
Type:
float

totkey

The total number of key positions. Value is clamped to the range [1,100].
Type:
int

totpart

The total number of particles. Value is clamped to the range [1,100000].
Type:
int

type

The type of the effect. Deprecated.
Type:
int

vectsize

The size of vectors associated to the particles (if any). Value is clamped to the range [0.0,1.0].
Type:
float

vGroup

The name of the vertex group used for emitted particles.
Type:
str

Generated by Epydoc 2.1 on Thu May 10 20:32:00 2007 http://epydoc.sf.net