Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Text animator expressions controlled by slider controls

  • Text animator expressions controlled by slider controls

    Posted by Dustin Novacek on January 4, 2019 at 2:26 pm

    Hello everybody, I need your help. I have found many answers on this forum before in the past but this problem I just cannot find a solution to, maybe I have to dig a little deeper. But I am trying to animate text using expressions and the expressions have adjustable parameters(amplitude, freq, decay). I am trying to parent those parameters to slider controls so it is easier for me to navigate to control them rather than go into the text layer and find the expression selector drop down. When I parent the specific parameter(amplitude) to a slider control I get various errors, most common is “Bad argument: couldn’t find layer named ‘Control Layer’ expression disabled”. Here is a copy of the specific expression I am using, thanks to Dan Ebberts and his wonderful expressions.

    **Working Expression**
    freq = 05;
    amplitude = 100;
    decay = 9.0;
    delay = .05;
    myInDelay = delay*textIndex;
    myOutDelay = delay*(textTotal -textIndex + 10); tStart = inPoint + myInDelay;
    tStop = outPoint – myOutDelay;
    if ((time < tStart) || (time > tStop)){
    t = 0; }else{
    if (time < (tStart + tStop)/4){ t = time – tStart;
    }else{
    t = tStop – time;
    } }
    s = amplitude*Math.cos(freq*t*2*Math.PI)/Math.exp(decay*t);
    [s,s]

    ****

    **Slider Controlled expression**(does not work)
    freq = thisComp.layer(“Controls”).effect(“freq”)(“Slider”);
    amplitude = 100;
    decay = 9.0;
    delay = .05;
    myInDelay = delay*textIndex;
    myOutDelay = delay*(textTotal -textIndex + 10); tStart = inPoint + myInDelay;
    tStop = outPoint – myOutDelay;
    if ((time < tStart) || (time > tStop)){
    t = 0; }else{
    if (time < (tStart + tStop)/4){ t = time – tStart;
    }else{
    t = tStop – time;
    } }
    s = amplitude*Math.cos(freq*t*2*Math.PI)/Math.exp(decay*t);
    [s,s]

    ****
    I am also using the control layer on a null object if that makes any difference

    **Working Expression**
    freq = 05;
    amplitude = 100;
    decay = 9.0;
    delay = .05;
    myInDelay = delay*textIndex;
    myOutDelay = delay*(textTotal -textIndex + 10); tStart = inPoint + myInDelay;
    tStop = outPoint - myOutDelay;
    if ((time &lt; tStart) || (time > tStop)){
    t = 0; }else{
    if (time &lt; (tStart + tStop)/4){ t = time - tStart;
    }else{
    t = tStop - time;
    } }
    s = amplitude*Math.cos(freq*t*2*Math.PI)/Math.exp(decay*t);
    [s,s]

    **Slider Controlled expression**(does not work)
    freq = thisComp.layer("Controls").effect("freq")("Slider");
    amplitude = 100;
    decay = 9.0;
    delay = .05;
    myInDelay = delay*textIndex;
    myOutDelay = delay*(textTotal -textIndex + 10); tStart = inPoint + myInDelay;
    tStop = outPoint - myOutDelay;
    if ((time &lt; tStart) || (time > tStop)){
    t = 0; }else{
    if (time &lt; (tStart + tStop)/4){ t = time - tStart;
    }else{
    t = tStop - time;
    } }
    s = amplitude*Math.cos(freq*t*2*Math.PI)/Math.exp(decay*t);
    [s,s]

    Kalleheikki Kannisto replied 7 years, 7 months ago 2 Members · 5 Replies
  • 5 Replies
  • Kalleheikki Kannisto

    January 4, 2019 at 3:10 pm

    I didn’t look very thoroughly, but it might be that you just need to add .value after (“Slider”).

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Dustin Novacek

    January 4, 2019 at 6:29 pm

    I will try that. Thanks for your input. What does the .value do to the expression To make it work

  • Kalleheikki Kannisto

    January 5, 2019 at 9:51 am

    In this case, it should get the numeric value of the slider instead of the slider as an object. I don’t know if that’s the problem here, but it could be.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Dustin Novacek

    January 5, 2019 at 6:03 pm

    I figured out the problem. The problem is related to CS6 and not CC. If I link those parameters to a slider control with a custom name like “Freq” or “Amp” the expression returns an error. But if I leave the Slider Controls name to the stock “Slider Control” then the parenting to the expression works fine. It is a weird problem. But I want to make sure the presets I make work with all versions of AE since I use multiple versions. If I create a preset in CC 17 then the preset wont work in previous versions.

  • Kalleheikki Kannisto

    January 5, 2019 at 6:32 pm

    Ah, ok. I wonder if it is because you have an effect named “freq” as well as a variable named “freq”.

    Kalleheikki Kannisto
    Senior Graphic Designer

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