Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions linear expression position to scale

  • linear expression position to scale

    Posted by Darío Saquetti on July 24, 2015 at 3:11 pm

    Hello guys.

    I am trying to create a slideshow where I have 5 “cards” next to each other and when I move a null that to a certain position the present card goes from 100% 75 % ( scale down ) and the next one should scale up (75% to 100)

    The case is a managed to solve the first part of the trick ( card scales down) but not the second part ( card scales up)

    Can you give me a light here? I hope my question is clear.

    Thanks
    Dario

    x = thisComp.layer("mov_scale").transform.position[0]
    scalex = ease(x, 1161.3, 662.7, 100, 75);
    [scalex,scalex];

    Darío Saquetti replied 11 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Xavier Gomez

    July 24, 2015 at 7:28 pm

    Hi,

    in case the scale varies when the null hover over the layer, you can use something like this, which is quite simple since it will be the same expression for all cards:


    x = Math.abs(thisComp.layer("mov scale").transform.position[0] - transform.position[0]);
    fadeDist = 500;
    s = ease(x, 0, fadeDist, 100, 75);
    [s,s];

    If the numbers you indicate do not correspond to any layer position, then:

    x = Math.abs(thisComp.layer(“mov scale”).transform.position[0] – 1161.3);
    fadeDist = 1161.3 – 662.7;
    scalex = ease(x, 0, fadeDist, 100, 75);
    [scalex,scalex];

    Xavier.

  • Darío Saquetti

    July 26, 2015 at 1:40 am

    Hi Xavier.

    I think the second one is the one I was looking for. The scale should be linked to an specific position of the null in the comp.Both ways are useful though.

    Thanks a lot!

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