I'm working on a UI on After Effects and I want to automate it with expressions.
I'm kinda stuck right now. Here's my issue :
I have a shape layer (SL 1) whose scale is animated. Above it, i have an other shape layer (SL 2). I want the SL 2 to never cross the SL 1, I want it to slide along when the SL 1 is growing up (as in Apple OS Desktop interface toolbar).
For that, I want to get the height/width of my SL 1. I used sourceRectAtTime() but unfortunately, this expression doesn't considered the evolution of my scale.
Is there a way to get the height/width of a layer evolving as my scale is changing ?
Is there a "toComp" expression but for scale's values ?
Tell me if I'm not clear on my demand.
Thank you very much !
This should give you the width and the height:
L = thisComp.layer("SL 1");
r = L.sourceRectAtTime(time,false);
s = L.scale;
w = r.width*s/100;
h = r.height*s/100;
Thank you very much, it works and it will really help me !