Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Trigger Two Keyframes With Alpha – not working

  • Trigger Two Keyframes With Alpha – not working

  • Dan Ebberts

    June 19, 2022 at 2:47 pm

    What does your expression, in its final form, look like?

  • Toby Waskowitz

    June 19, 2022 at 4:45 pm

    Here is the final version (there are two keyframes in the scale slider):

    N = thisComp.layer(“Controls”).effect(“Scale”)(1)
    sampleSize = [1,1];
    L = thisComp.layer(“Alpha Scale”);
    P = L.fromComp(toComp(anchorPoint));
    lum = rgbToHsl(L.sampleImage(P,sampleSize/2,true,time))[2];
    t = 0;
    t1 = N.key(1).time;
    t2 = N.key(N.numKeys).time;
    if (lum == 1){
    t = thisComp.frameDuration
    while ((t < t2 – t1) && t <= time){
    lTemp = rgbToHsl(L.sampleImage(P,sampleSize/2,true,time-t))[2];
    if (lTemp < 1){
    t -= thisComp.frameDuration;
    break;
    }
    t += thisComp.frameDuration;
    }
    }
    v = N.valueAtTime(t1 + t)
    value + [v,v,v]

  • Dan Ebberts

    June 19, 2022 at 9:10 pm

    I think the easiest way would be to apply the keyframe overshoot expression to the slider and then change this line:

    while ((t < t2 - t1) && t <= time){

    to this:

    while ((t < (t2 - t1)*3) && t <= time){

    in the sampleImage() expression.

  • Toby Waskowitz

    June 20, 2022 at 9:00 am

    That’s just awesome! hehe… I was also thinking the same way, I did apply the overshoot to the slider, but it didn’t work without that new line, but now it’s working flawlessly. I really want to thank you very much for helping me with this.

Viewing 11 - 14 of 14 posts

Log in to reply.

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