View Full Version : instance animation change by particle speed

09 September 2010, 11:14 AM

I remember seen this long time ago, but can't find it any more...

I have a bunch of animated fishes that are swimming. it's a particles system with instanced shapes.

I would like to find a way that the animation changes speed as the particles accelerate or decelerate.

in two words I'ld like to swim faster when the particles goes faster and vice versa....

if you know how or can point me to a way of doing it, it would be great.



PS: I remember a scene with crabs...they changed speed/animation speed with a script.

09 September 2010, 05:07 AM
This is assuming you are running a looped out-of-range type animation.

You can use the Particle Age keyframe offset in the Shape Instance operator. What you would do is something like this:

Get the Speed Magnitude of the particle (more than likely it would be something in the range of 0.02 to 0.09)
Multiply it by something like 100.0 so you get a more usable value for use with time by frames
Get the current particle age and add the Speed magnitude value to that.

A script operator might look something like this:

on Proceed pCont do
count = pCont.NumParticles()

for i in 1 to count do
pCont.particleIndex = i
speedMagnitude = (length pCont.particleSpeed)*100
adjustedAge = pCont.particleAge + speedMagnitude
pCont.particleAge = adjustedAge

EDIT: Here is an example:

09 September 2010, 06:58 AM
That's exactly what I was looking for..thank you for the help!

and Thank you for the video :)


CGTalk Moderation
09 September 2010, 06:58 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.