AE Expression to get Size of Text Layer?
Morning all,
Got another one that I need help with (and this one's actually a two-parter).
The first part is the easy part--I'm trying to get the actual size of a text layer, I found an old expression that purports to do it but it's erroring out. This is the expression:
targetLayer = thisComp.layer("Name Name Name Name");
h = targetLayer.sourceRectAtTime().height;
s = targetLayer.transform.scale[1];
p = (s – 100)* .01;
finalSize = w + p * h;
finalSize
The error is coming in at this line: "p = (s – 100)* .01;"
AE is calling it a syntax error with an invalid or unexpected token. I'm not sure why, but that's what's happening. Can anybody help me with this one?
Second half of the problem, and this is more about figuring out the math than anything else (so if there are any math whizzes out there I need your help!). What I'm using this for is to create an end credits sequence, and what I'm looking to do is center everything vertically and horizontally on the screen. The challenge is, the credits each have a title text layer, followed by an orange bar (shape layer), and then whatever names come after. The Y positions of the title and names text layers are linked to the Y position of the orange bar and offset by a specific amount (20 pixels above for the titles, 25 pixels below for the names).
Basically what I'm trying to come up with is the match to figure out, based on the height of the title text layer and the height of the names layer, how far from the center of the comp (960x540) I have to offset the orange bar to make everything center-aligned. I'm struggling with the math on this one though and
I'd be grateful for any help on either half of this!
