Scripted deamon - particel.getTime() problem
Posted: Tue Jul 06, 2010 1:23 am
Hi,
i'm trying to write some simple deamon, but hit the wall with some problems. Seams that the script is ok, but something is not ok whenever i write down the function particle.getTime().
When the simulation starts, it point out to that line, telling me that something is wrong with that piece of code...
So if anyone has any idea what's wrong here, let me know please.
Here's the code
thnx in advance!
Igor
i'm trying to write some simple deamon, but hit the wall with some problems. Seams that the script is ok, but something is not ok whenever i write down the function particle.getTime().
When the simulation starts, it point out to that line, telling me that something is wrong with that piece of code...
So if anyone has any idea what's wrong here, let me know please.
Here's the code
Code: Select all
#--------------------------------------------------
# Function: applyForceToEmitter
# This function is called by the simulation engine
# when external forces should be applied to the
# particles in the emitter.
#--------------------------------------------------
def applyForceToEmitter( emitter ):
import math
particle = emitter.getFirstParticle()
while particle:
ptime = particle.getTime()
up = Vector.new(0, math.atan(ptime*20-5)/15+0.1, 0)
particle.setExternalForce( up )
particle = particle.getNextParticle()
#--------------------------------------------------
Igor