Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animate a “parent” with checkbox

  • Animate a “parent” with checkbox

    Posted by Ricardo Martins on July 25, 2014 at 6:55 pm

    Hi there, I’m animationg a mouse draging a bunch of stuff on screen.

    So I was wondering if I could just animate the mouse and make a checkbox expression or anything like it with a that would “parent” the icons to be dragged and droped.

    I left this “.toComp” because the there’s a null parented to the mouse and other stuff.

    My problem now is that when I uncheck the checkbox the icons return to their previous position, so I was wondering if theres a way to update it’s position when I turn the check down.

    Or is there a smarter way to do this?

    if (effect("CheckFinal")("Checkbox") == 1) thisComp.layer("arrow").toComp([0,0,0]) else transform.position

    Ricardo Martins replied 12 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 25, 2014 at 7:20 pm

    It’s probably going to be something like this:


    cb = effect("CheckFinal")("Checkbox");
    if (cb.value == 1){
    thisComp.layer("arrow").toComp([0,0,0])
    }else if (cb.numKeys > 0){
    n = 0;
    n = cb.nearestKey(time).index;
    if (cb.key(n).time > time) n--;
    if (n > 1){
    thisComp.layer("arrow").toComp([0,0,0],cb.key(n).time)
    }else{
    value;
    }
    }else
    value

    Dan

  • Ricardo Martins

    July 25, 2014 at 8:24 pm

    Thanks Dan, that worked like a charm!

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