- April 26, 2021 at 10:58 am
I want to create a project in which there are two titles. Each of them have auto scale box . I could do this with the help of expressions, but i am stuck as both the box width should be the same, it should be which ever have longer text.
please find image attached for better understanding
looking forward for your help
- April 26, 2021 at 4:19 pm
The Math.max() function returns the largest value from the arguments you pass to it, so we can set the width of both boxes to the larger of the two widths.
The expression will look something like this:
Math.max(thisComp.layer("Title 1").sourceRectAtTime(time).width, thisComp.layer("Title 2").sourceRectAtTime(time).width);
- April 27, 2021 at 9:32 am
thanks for your reply. after pasting this expression im getting error.
“result must be 2 dimension and 1.”
- April 27, 2021 at 11:28 pm
Yes, that will only get you the width. If you’re putting this in a rectangle size property, or in a scale property, you will also need to calculate the height and pass both dimensions.
Without seeing exactly what you’re doing, I can only give hints.
- April 29, 2021 at 8:36 am
I could get pass through that error. But i can not achieve to stay the rectangle with my text using Math.max the shape just keep moving in other direction
my text are Right align.
please find attached my project
Log in to reply.