Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Checkbox OFF to trigger animation

  • Checkbox OFF to trigger animation

    Posted by Pedro Amaral on July 23, 2018 at 1:23 pm

    Hi,

    I have this expression set up with time-remap to trigger one animation IF the checkbox is On:

    n = 0;
    p = comp(“Controller”).layer(“Death”).effect(“Player 01”)(“Checkbox”);
    if (p.numKeys > 0){
    n = p.nearestKey(time).index;
    if (p.key(n).time > time) n–;
    }
    if (n > 0 && p.key(n).value)
    time – p.key(n).time
    else
    0

    However, I’m trying to get it to work only when the checkbox is turned OFF.

    I’ve tried changing things around in the expression but haven’t been able to figure out what part of the expression is dictating the True/False of the Checkbox.

    Any ideas?

    Thanks in advance!

    Pedro Amaral replied 7 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Alex Printz

    July 23, 2018 at 1:59 pm

    try this:

    n = 0;
    p = effect("Player 01")("Checkbox");
    if (p.numKeys > 0){
    n = p.nearestKey(time).index;
    if (p.key(n).time > time) n--;
    }
    if (n > 0 && p.key(n).value == 0)
    time - p.key(n).time
    else
    0

    Alex Printz
    Mograph Designer

  • Pedro Amaral

    July 23, 2018 at 3:06 pm

    Awesome!

    Thank you so much Alex

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