Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression to keep object scaling from a specific point

  • Expression to keep object scaling from a specific point

    Posted by Dylan Hay on March 2, 2019 at 1:24 am

    I’m trying to get the right side black bar to stay attached to the right side of the white bar even after the text within the bar has been adjusted.

    Currently this black bar is scaling in size depending on the text and I need it to continue doing so but in a way that it dosn’t mess with the animation of the black bar appearing from the right to left.

    I have little to no knowledge of expressions in after effects but I can try and provide more information if needed.

    Example: The Scaling with the default text used

    Example: The Scaling with other text used

    As you can see from the example above the Black bar has scaled correctly but is moving from the edge of the white bar. All anchor points are also at the top left of the white bar.

    L=thisComp.layer("Names");
    X=L.sourceRectAtTime().width;
    Y=L.sourceRectAtTime().height;
    P=thisComp.layer("Control").effect("Slider Control")("Slider");
    [X,Y]+[P,P]

    Arthur Hakhverdian replied 7 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Arthur Hakhverdian

    March 21, 2019 at 10:15 am

    Sorry, Dylan but I already hate what you’re trying to do here. ???? Far too many layers to accomplish something that requires at MOST two and maybe even just one. See this here? https://drive.google.com/file/d/1e3GLat97akYc_Upgz2ZFnnLJKwP-yPux/
    Even if your desired end result slightly differs from what’s in that link, it should probably serve as an example of how stuff like this should REALLY be built.

    At the very least a good place to start would be to make both the dark grey and the white rectangles sub-elements of ONE shape layer. The parallel reveal of the text, if it’s only to be horizontal, can be accomplished via a properly rigged Linear Wipe effect.
    Or, better yet, have a look at what I did and try adopting that.

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