Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Particle emit exact number every 15 frames

  • Particle emit exact number every 15 frames

    Posted by Kristianus Ligara on October 27, 2009 at 4:55 am

    Hi everyone, I have a question.

    I wanted a particle emitter to emit 100particle/second for 15 frames every 30 frames (1/2 sec.)

    so it would go :

    frame 0 to 15, 0 particle.
    frame 15 to 30, 100 particle.
    next 15 frames, 0 particle.
    next 15 frames, 100 particle.

    so on and so forth.

    I have difficulty pinpointing the conditions to be used.
    what should I use? will timecode work? and if so, can someone help me find out the conditional for the if statement?
    maybe a while statement work better?

    pseudocode:

    if (frames = first 15 frames in a second) // I need help with the conditions
    {
    emit 0 particles;
    }else{
    emit 100 particles/sec;
    }

    Motion Graphics Designer
    https://www.chaosraven.com

    Kevin Camp replied 16 years, 6 months ago 3 Members · 3 Replies
  • 3 Replies
  • Kevin Camp

    October 27, 2009 at 3:20 pm

    something like this should work:

    Math.round(time%1)*100

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Xinlai Ni

    October 27, 2009 at 3:27 pm

    It depends on what particle system you are using. I think both CC and Particular only allow you to animate the speed at which particles are emitted, not the exact number of particles.
    In case you mean that, for example, in Particular, you can use this expression in the Particles/sec property:
    ((timeToFrames() % 30) < 15) ? 100 : 0

    It may be hard to see the effect until you adjust the particle life to 0.5s (on a 30fps frame rate).

    Xinlai Ni
    Software Engineer, Google Inc.

  • Kevin Camp

    October 27, 2009 at 3:29 pm

    this would be more flexible, allowing for the low end of the cycle to have a value other than 0. plus it’s easier to adjust the interval and other values if needed.

    minParticles = 0;
    maxParticles = 100;
    interval = 1; // value in seconds

    n = time%interval;
    if (n < interval/2) minParticles else maxParticles

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy