ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Right angled Labels in expressions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Adam Zygadlo
Right angled Labels in expressions
on Oct 15, 2019 at 2:06:51 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.'


Return to posts index

Dan Ebberts
Re: Right angled Labels in expressions
on Oct 15, 2019 at 4:25:43 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



Return to posts index

Adam Zygadlo
Re: Right angled Labels in expressions
on Oct 16, 2019 at 9:32:02 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);
<b>[c[0]-x,a[1]]</b>


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.'


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]