Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Change the position of a NULL object with respect to Rectangle Width

Tagged: 

  • Change the position of a NULL object with respect to Rectangle Width

    Posted by Tonmoy Moves on September 22, 2020 at 5:50 pm

    Hi, I have probably been looking at the screen for too long and I believe that there is a very simple solution to this:

    I have a red rectangle shape that dynamically changes it’s width (path NOT Transform) when text is entered using Expressions (screenshot attached).

    I also have a NULL object and I would like it’s position to change with respect to the left edge of the box when it increases or decreases in width when text is entered (screenshot attached).

    Composition Width: 1000px

    Thank you!

    Tonmoy Moves replied 5 years, 7 months ago 3 Members · 4 Replies
  • 4 Replies
  • Travis Landers

    September 23, 2020 at 5:29 pm

    maybe look into using information from sourceRectAtTime to adjust the position of the null?

  • Matt Volp

    September 23, 2020 at 7:25 pm

    Sure, try this. Parent the null to the rectangle, and put this expression in the null’s position property.

    myRectangle = //pickwhip your rectangle
    l = myRectangle.sourceRectAtTime().left;
    t = myRectangle.sourceRectAtTime().top;
    h = myRectangle.sourceRectAtTime().height;
    [l,t + h/2];

    It’s worth noting you’ll need to ‘unseparate’ the null’s position dimensions.

  • Tonmoy Moves

    September 26, 2020 at 8:33 pm

    Thanks for that response. I did unseparated the Null’s position dimensions and parent it to the Rectangle. But it seem that the .left and .top functions are not working. This is the error I get:

  • Tonmoy Moves

    September 27, 2020 at 3:35 pm

    Also for the benefit of everyone. This is how the expression currently works.

    https://vimeo.com/462362601/a83b5a2796

    Disclaimer:

    My reason for linking a NULL is because there are other design components that rely on it. Hope that helps.

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