Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects › How to link a null to different corners of a text box

  • How to link a null to different corners of a text box

    Posted by Kyle Venberg on August 18, 2020 at 9:44 pm

    Hello,
    This may seem like a simple request (but I can’t figure it out haha)… I have a text box and I want to attach nulls to the lower left and upper right of the text box. I need to use the scale property on the text layer and need the nulls to follow (that’s my issue).

    I am trying to do this so I can link the position of another text element to that lower left null. I’ve tried so many different approaches and can’t figure out a resolution that works when I scale the text.

    Here’s my attempt (expression for the null’s position):
    l = thisComp.layer("Text ");
    p = l.transform.position;
    r = l.sourceRectAtTime();

    [p[0], p[1] + r.top/2]

    Thanks,
    Kyle

    Filip Vandueren replied 6 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Filip Vandueren

    August 19, 2020 at 9:20 am

    the sourceRect gives just the dimensions of the source, so yo have to take into account rotation, scale, parenting,…

    top left would be this:


    l=thisComp.layer("Text");
    sr=l.sourceRectAtTime();

    pos = l.toWorld([sr.left, sr.top]);

    if (thisLayer.hasParent) parent.fromWorld(pos);
    else pos

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