ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Text animator expressions controlled by slider controls

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Dustin Novacek
Text animator expressions controlled by slider controls
on Jan 4, 2019 at 2:26:01 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]



Return to posts index

Kalleheikki Kannisto
Re: Text animator expressions controlled by slider controls
on Jan 4, 2019 at 3:10:45 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


Return to posts index

Dustin Novacek
Re: Text animator expressions controlled by slider controls
on Jan 4, 2019 at 6:29:06 pm

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


Return to posts index


Kalleheikki Kannisto
Re: Text animator expressions controlled by slider controls
on Jan 5, 2019 at 9:51:28 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


Return to posts index

Dustin Novacek
Re: Text animator expressions controlled by slider controls
on Jan 5, 2019 at 6:03:38 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.


Return to posts index

Kalleheikki Kannisto
Re: Text animator expressions controlled by slider controls
on Jan 5, 2019 at 6:32:17 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]