Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Changing Shape Layers size (width) due to text width

  • Filip Vandueren

    July 23, 2020 at 9:48 am

    BTW,

    instead of making the box with rectangle and two expressions, it is better to do it with a Path-shape:

    expression for Path of a shapeLayer:

    t=thisComp.layer("my_text");
    sr = t.sourceRectAtTime();

    marginH = t.text.sourceText.style.fontSize * 0.5;
    marginV = marginH * 0.75;

    tl = fromCompToSurface(t.toComp([sr.left - marginH, sr.top - marginV]));
    tr = fromCompToSurface(t.toComp([sr.left + sr.width + marginH, sr.top - marginV]));
    br = fromCompToSurface(t.toComp([sr.left + sr.width + marginH, sr.top + sr.height + marginV]));
    bl = fromCompToSurface(t.toComp([sr.left - marginH, sr.top + sr.height + marginV]));

    createPath( [tl,tr,br,bl], [], [], true);

    Add Fill, Stroke, rounded corners to taste.

    The upside of this method is that the Path text-box can rotate with the Text. Even if the Text is rotating in 3D.

  • Ter Ber

    July 23, 2020 at 1:08 pm

    Perfect….absolutely perfect!
    Asking for help and being blessed with someone else, whom you’ve never met and from any part of the world to collaborate and showing kindness is the most satisfying thing.

    Thank you SO much Filip (and everyone else here) for your contributions.
    🙂

  • Ter Ber

    August 1, 2020 at 12:18 pm
Page 3 of 3

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