Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Active ‘if statement’ over a number of frames

  • Active ‘if statement’ over a number of frames

    Posted by Chris Ellingworth on January 26, 2021 at 1:17 am

    If I want to generate a random number in an expression and have an animated blink happen if a certain number is chosen, how could I have the blink last for more than one frame? Like an ‘if statement’ on the opacity of a layer allowing the opacity to be at 100% over 3 frames if the number 5 is randomly generated.

    There may well be a better way to do this but I wanted to know for my general knowledge if it’s possible to have something trigger from a random number in an expression (as an example) and be ‘on’ for more than one frame from that trigger.

    Chris Ellingworth replied 5 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Filip Vandueren

    January 26, 2021 at 11:48 am

    The most straightforward way is probably to start your expression with

    posterizeTime(10); // evaluates at 10fps

    Then the rest of your code

  • Chris Ellingworth

    January 26, 2021 at 10:02 pm

    Thank you. I see my problem was that I had the random statement in the same expression as the opacity ‘if statement’. I have put the random statement with the posterizeTime statement in an expression on an adjustment layer with a slider now and it works the way I need it to. Thanks again.

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