Skip to main content
Participating Frequently
February 11, 2022
Answered

is it possible to use two expressions at once?

  • February 11, 2022
  • 1 reply
  • 474 views

dear community, i would like to use multiple expressions in the function menu. as seen in the picture, rightt now the data from mocha iiss fillinf up the expression space. i would like to add smooth and clamp functions too. how can i do that?

thanks in advance

This topic has been closed for replies.
Correct answer Dan Ebberts

Generally, when you combine two expressions, you assign the result of the first expression to a variable and then incorporate that variable into the calculation for the second expression. In your case though, smooth() only works on the pre-expression value of the property, so you can't do clamp, then smooth, only smooth, then clamp, which would be like this (but probably isn't what you want):

s = smooth(.5,11);
min=[97.0,97.0];
max = [103.0,103.0]
clamp(s,min,max);

 

1 reply

Mylenium
Legend
February 12, 2022

Of course you can expand and modify any expression as you see fit:

 

mCorner=effect("Corner Pin")(1);


min=0;
max=500;


X=clamp(min,max,mCorner[0]);
Y=clamp(min,max,mCorner[1]);


[X,Y]

 

smooth(0.2,5,time)

 

Naturally, you'll have to fill in some real values as needed for your project here.

 

Mylenium

iklimdAuthor
Participating Frequently
February 13, 2022

thanks a lot!