Expression behaves differently in subcompact
Hi,
I followed the tutorial from ECAbrams: https://www.youtube.com/watch?v=EG7m3j1X9hQ&t=207s
In which the size of a rectangle refers to the size of a textbox.
This is the expression I got from the video:
L=thisComp.layer("subtitle")
X = L.sourceRectAtTime().width;
Y = L.sourceRectAtTime().height;
P=thisComp.layer("controller").effect("padding")("Slider");
[X,Y]+[P+40,P]
I want to use the expression so I don't always need to resize the rectangle behind the text.
My plan is that I only need to keyframe the source text.
My problem is that the source text changes on the new keyframe correctly but the rectangle already changes to the new size of the textbox after 40% of the time passed after the keyframe before. So it's not synchronous and I have no clue why.
The only fix I randomly discovered is to put the textbox and the text layer in a subcomp.
But this makes no sense in my opinion and I would like to have those 2 layers in my main comp to animate the source text easily.