ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: How do I make this rectangle stay put when it resizes?

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Al Edwards
Re: How do I make this rectangle stay put when it resizes?
on Jun 8, 2020 at 4:07:20 pm

Oh duh, I just figured it out... I messed up the order-of-operations on the width calculation.

Here's the corrected code in case it helps someone else!

-Al

t = thisComp.layer("Text").sourceRectAtTime();
t2 = thisComp.layer("Text 2").sourceRectAtTime();
logo = thisComp.layer("Logo").sourceRectAtTime();
w = Math.max(t.width, t2.width) / 2 + logo.width;
h = t2.height / 2;
l = t2.left;
top = t2.top;

[w + l + logo.width, h + top]; // Keeps rectangle aligned left


Posts IndexRead Thread 


Current Message Thread:





© 2020 CreativeCOW.net All Rights Reserved
[TOP]