Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Checkbox expression control can’t be animated.

  • Checkbox expression control can’t be animated.

    Posted by Liam Hammer on July 18, 2017 at 3:17 am

    I’ve set up a nested comp, where a layer in the child has its opacity triggered by a checkbox expression in an adjustment layer in the parent. The expression is:

    The control works fine. When I toggle the checkbox on and off, the nested element responds appropriately. However, if I attempt to animate the checkbox (e.g. to have the visibility toggle halfway through an animation), the child comp only seems to respond to the first keyframe on the checkbox control. If I animate it from on to off, the layer will only be on. If it is from off to on, it will only be off.

    Is there a way that I can fix this?

    if (comp("Parent").layer("Controls").effect("Checkbox Control")("Checkbox")==0) 0 else 100

    Liam Hammer replied 9 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    July 18, 2017 at 3:51 am

    If the precomp layer doesn’t start at time 0 in the outer comp, you need to compensate with something like this:

    C = comp(“Parent”);
    ctrl = C.layer(“Controls”).effect(“Checkbox Control”)(“Checkbox”);
    L = C.layer(thisComp.name);
    cb = ctrl.valueAtTime(time + L.startTime);
    if (cb) 100 else 0

    Dan

  • Liam Hammer

    July 18, 2017 at 4:33 am

    The child does start at time 0 on the parent, though. It does have some time remapping applied to it, though.

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