Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Link position to scale expression ?

  • Link position to scale expression ?

    Posted by Lucas Piazzini on April 14, 2020 at 12:49 pm

    Hello guys ! First of all hello, this is my first post here ☺

    I am doing a bouncing ball animation with expressions and would like to create it’s shadow. I’d like to make it scale based on the ball’s height (position, more generally), but I am quite running out of ideas to transcribe it’s height into a %.. I need help please !

    Thank you for the answers in advance =)

    Lucas Piazzini replied 6 years, 1 month ago 3 Members · 5 Replies
  • 5 Replies
  • Andrei Popa

    April 14, 2020 at 2:22 pm

    https://www.youtube.com/watch?v=no9gtkH3sGY

    Andrei
    My Envato portfolio.

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

  • Lucas Piazzini

    April 14, 2020 at 2:23 pm

    Thank you very much !

  • Scott Mcgee

    April 14, 2020 at 2:28 pm

    This is kind of what you want. I don’t have anything that caps it at a percentage, but hopefully it’ll get you started.

    posTwo = thisComp.layer("Shape Layer 2").transform.position.key(1).value[1];
    currentPos = thisComp.layer("Shape Layer 2").transform.position[1];

    x = transform.scale[0] - (100 - (currentPos/posTwo)*100);
    y = transform.scale[1];
    [x,y]

  • Scott Mcgee

    April 14, 2020 at 2:28 pm

    Just seen Andrei has answered you, hahaha. So ignore me.

  • Lucas Piazzini

    April 14, 2020 at 6:23 pm

    After hours of headaches and with the help of my Data scientist father, I was able to make a much simpler and versatile version that revolves around no other constant than a factor unlike school of motion, it also allows you to control the speed of evolution from minimum scale to maximum scale, aswell as the minimum scale ! Thanks for your help I wouldn’t have improved without your link !

    Factor = 20 //Control the scale variation, smaller factor = smaller minimum size

    var diameter = thisComp.layer("Ball").content("Ellipse 1").content("Ellipse Path 1").size[1];
    var ball_yPos = thisComp.layer("Ball Pos").transform.position[1];
    var ground = thisComp.layer("Ground").transform.position[1];
    var hDepart = diameter*2; //Control the scale speed
    var diff_BallGround = ground - ball_yPos;

    if (diff_BallGround<hDepart){ //Shadow Scaling
    substract = (diff_BallGround/Factor)
    }else{
    substract=hDepart/Factor // Minimum size
    }

    if (substract&lt;0){ //To prevent the shadow from getting larger
    substract = 0
    }

    [100-substract,transform.scale[1]]

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