Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Position changes on the scale of the layer

  • Position changes on the scale of the layer

    Posted by Mac Lad on September 1, 2018 at 7:40 am

    Hi Awesome Peoples;
    I am animating a graph which has a bar(rectangle) and point(circle) which is on the upper edge of the bar. The bar is scaling from 0 to 100 in the y-direction. I tried an expression in the position of the point but it does not follow the bar to its total length.
    For a basic idea of my layer and position

    x=thisComp.height;
    sy=thisComp.layer("bar").transform.scale[1];
    m=x-sy;
    [transform.position[0],m];

    Mac Lad replied 7 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • James Ronan

    September 1, 2018 at 5:22 pm

    If your circle layer has it’s anchor point centered you could try this expression on it’s position property:


    L = thisComp.layer("bar");
    r = L.sourceRectAtTime(time,false)
    L.toWorld([r.width/2,r.top]);

  • Mac Lad

    September 5, 2018 at 10:22 am

    Thank you so much!!! that really helps man…I am new to scripting and especially new to “toWorld” expression. Made a few tweaks on my side to work as I needed. Final expression is bellow

    L = thisComp.layer("bar");
    r = L.sourceRectAtTime(time,false);
    s=L.toWorld([r.width/2,r.top]);
    [value[0],s[1]];

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