ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Two dynamic boxes with relationship with each other

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Emiliano Grimaldi
Two dynamic boxes with relationship with each other
on Sep 5, 2019 at 10:30:51 am

Hi all,

I have two dynamic boxes/titles that should have a relationship with each other.
The two boxes contain titles and are on top of each other on the Y-axis.
I would like an expression that makes both boxes/titles expand to the width of the longer box/title, i.e. The one with the longer text dictates the width of the titles.

Thank you for any help!

I used the expression below to create the boxes

title = thisComp.layer("Title").sourceRectAtTime();padding = effect("Padding")("Slider");[title.width + padding, title.height + padding];

http://www.emilianogrimaldi.it
http://emilianogrimaldi.blogspot.com


Return to posts index

Dan Ebberts
Re: Two dynamic boxes with relationship with each other
on Sep 5, 2019 at 1:34:38 pm

I haven't test this, but I think it might look like this:

title1 = thisComp.layer("Title 1").sourceRectAtTime();
title2 = thisComp.layer("Title 2").sourceRectAtTime();
w = Math.max(title1.width,title2.width);
h = Math.max(title1.height,title2.height);
padding = effect("Padding")("Slider");
[w + padding, h + padding];



Dan



Return to posts index

Emiliano Grimaldi
Re: Two dynamic boxes with relationship with each other
on Sep 9, 2019 at 10:42:52 am

Dan,

Thank you very much!

This works like a charm!!!

Emiliano

http://www.emilianogrimaldi.it
http://emilianogrimaldi.blogspot.com


Return to posts index

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