Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Right angled Labels in expressions

  • Right angled Labels in expressions

    Posted by Adam Zygadlo on October 15, 2019 at 2:06 pm

    Hey there,

    Is it possible to use expressions to make right angle graphics? I will explain in detail below.

    Recently, I have decided to update the information labels that I use for my client projects and animations.

    Here’s the layout to the label:

    In previous builds, I built a basic rig with three points or nulls that I use to layout the label: A) Starting Point, B) Elbow for Arm, and C) Key information of the text.
    Then I used the beam effect to connect between the three nulls to form the arm for the label. Using null A and C, I can position them on stage to highlight key information on the screen. Once I am happy with the position of A and C, then I make sure that B is right-angled at 45-degrees. I used the pick whip to connect the height of null B to the height of null A and then manually adjust the weight of null B to align a 45-degree angle between null A and C.

    Is there a way to use expressions to produce a right angle on Null B where it calculates the angle different the other nulls, without manually adjusting it myself?

    I really appreciate your time and thank you in advance.

    Cheers,
    Addz

    Adam Jozef Zygadlo
    Motion Graphic Designer

    07708 124 915
    http://www.jarbrain.com
    ‘Filled with brainy goodness.’

    Adam Zygadlo replied 6 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 15, 2019 at 4:25 pm

    Something like this maybe:

    a = thisComp.layer(“A”).position;
    c = thisComp.layer(“C”).position;
    d = a – c;
    x = Math.abs(d[1])*Math.tan(Math.PI/4);
    [a[0]-x,c[1]]

    Dan

  • Adam Zygadlo

    October 16, 2019 at 9:32 am

    Hey Dan,

    Thank you very much, that did the trick. I had to switch A and B in the last line of code, around in order to bend the elbow in the correct way to the label.

    a = thisComp.layer("Joint A").position;
    c = thisComp.layer("Joint C (Point)").position;
    d = a - c;
    x = Math.abs(d[1])*Math.tan(Math.PI/4);
    [c[0]-x,a[1]]

    Apart from that, it’s perfect and it will help save a small amount of time when producing 100’s of labels. Thank you Dan, you are a genius with code.

    All the best until next time,
    Cheers,
    Addz

    Adam Jozef Zygadlo
    Motion Graphic Designer

    07708 124 915
    http://www.jarbrain.com
    ‘Filled with brainy goodness.’

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