Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Basic expressions question: I wanted to scale. got it done, but don’t understand why it worked…

  • Basic expressions question: I wanted to scale. got it done, but don’t understand why it worked…

    Posted by Ori Kuper on January 23, 2012 at 5:10 pm

    Hello, i’m new to AE and expressions. I’m trying to make some very basic things, partially in order to understand the basics of the expressions language. I’m trying to learn from different sources online, including this site – all are good but i still can’t find the answer to this basic case:
    I was trying to write a very simple expression that will scale a layer (x,y,z all together) from [value] at the inPoint, to the [value+20] at outPoint. my first and most simple plan was to use something with ‘+20’ in it. I’ve tried it in different ways, including defining x,y,z (and then using them inside the expression) , and including using ‘+20’ in different ways inside the expression, but all i got was either error msgs OR i got only the x scaling, with the y and z not changing.
    i’ve tried it with both locked and unlocked aspect on the scale parameter (via checking and unchecking the little chain button), and got no different results.

    the only thing that DID work for all the 3 parts of the scale array (x,y,z) was this simple expression:

    linear(time,inPoint,outPoint,value,value*1.2);

    so – i got the job done, but i do not understand some very basic about the expressions language:

    1. why multiplication (*) worked, but addition (+) didn’t work?
    2. how could i still use the (+) or (-) in order to control the scaling of this layer? how should i write the expression for something like that?
    3. what if i wanted each of the 3 parts of the scale array to act differently? for example 1 to go +20, another to go -20 and the third to stay the same.

    thanks!
    Ori.

    Ori Kuper replied 14 years, 3 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    January 23, 2012 at 5:42 pm

    1) Multiplying by 1.2 sets each channel to 120% of its original value.

    2) linear(time,inPoint,outPoint,value,value+[20,20,20]);

    3) linear(time,inPoint,outPoint,value,value+[20,-20,0]);

    Dan

  • Ori Kuper

    January 23, 2012 at 5:51 pm

    thanks Dan. that’s why more simple compare to what i tried to write in there (which was weird locations for the + and 20s). thanks again!

    Ori.

  • Ori Kuper

    January 23, 2012 at 5:58 pm

    ok so i tried it with the ‘+’ before the ‘[x,y,z]’ and it worked, but now if i DO want to use multiplication for each of the 3 parts of the array?
    this didn’t work well:
    linear(time,inPoint,outPoint,value,value*[2,3,4])
    again, i believe i wrote it wrong. what is my mistake in the above?

    thanks,
    Ori.

  • Dan Ebberts

    January 23, 2012 at 6:03 pm

    That would be like this:

    linear(time,inPoint,outPoint,value,[value[0]*2,value[1]*3,value[2]*4])

    Dan

  • Ori Kuper

    January 23, 2012 at 6:15 pm

    got it. thanks Dan!

    Ori.

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