Scripted deamon - particel.getTime() problem

Post Reply
User avatar
starlighter
Posts: 5
Joined: Fri Jun 25, 2010 11:04 am

Scripted deamon - particel.getTime() problem

Post by starlighter » 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

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()



#--------------------------------------------------
thnx in advance!

Igor
Keep walking!

User avatar
tsn
Posts: 283
Joined: Fri Jun 11, 2010 7:22 am

Re: Scripted deamon - particel.getTime() problem

Post by tsn » Tue Jul 06, 2010 7:08 am

The getTime() function can only be used with keys. I think you're looking for the getAge() statement which is suited for particles.

Best,
Thomas
Thomas Schlick | Next Limit Technologies

User avatar
starlighter
Posts: 5
Joined: Fri Jun 25, 2010 11:04 am

Re: Scripted deamon - particel.getTime() problem

Post by starlighter » Tue Jul 06, 2010 1:27 pm

Thx Thomas!
I was trying to replicate some function i got in expression, and thought that i could use getTime for that...
found another way although, but bumped into another problem... :) i'll post a question if i don't find a solution soon...
Keep walking!

Post Reply