Hi,
Is it possible for a daemon to affect a particle based on its age?
eg - as each particle gets older, drag will increase to a predefined max.
cheers
Dave.
Daemon affect, based on particle age
Re: Daemon affect, based on particle age
Create a scripted daemon, open it with "Edit", look for "def applyForceToEmitter( emitter ):" and replace it (including the pass statement) with this piece of code:
Mind the indents! The script is based on this resource:
http://www.realflow.com/resources/item/ ... ch/58/drag
Code: Select all
def applyForceToEmitter( emitter ):
particle = emitter.getFirstParticle()
dragX = 1.0
dragY = 1.0
dragZ = 1.0
dragThres = 5.0
while particle:
pVel = particle.getVelocity()
pAge = particle.getAge()
forceX = -1 * (dragX * pVel.x * pAge)
forceY = -1 * (dragY * pVel.y * pAge)
forceZ = -1 * (dragZ * pVel.z * pAge)
drag = Vector.new(forceX,forceY,forceZ)
if (drag.module() <= dragThres):
particle.setExternalForce( drag )
particle = particle.getNextParticle()http://www.realflow.com/resources/item/ ... ch/58/drag
Thomas Schlick | Next Limit Technologies
-
DeltaJuliet
- Posts: 78
- Joined: Thu May 30, 2013 1:19 pm
Re: Daemon affect, based on particle age
Wow, fastest reply ever!
thankyou very much.
cheers.
Dave.
thankyou very much.
cheers.
Dave.