Thanks for the suggestion, Filip!
I tested the text layer method and it didn’t change much initially.
Only when I ditched the line isolating range selector for an expression selector, it stabilized a bit. (wonder why)
I noticed that now, glitching seems to mostly occur when hitting play at 0.
Switching from full res to half res and vice versa, or updating the layer in another way seems to fix it.
That said, when it catches some breath, playback is consistent now 👍
Also, all lines are scaling as they should.
Here are the updated expressions:
Source text
const widths = value.split("\r").map((_, i) => sourceRectAtTime(-1-i).width);
if (time == -2){
widths
}else{
value
}
Line Measurement:
const t = -time;
t == textIndex || time >= 0 ? 0 : 100;
Expression selector
const lW = text.sourceText.valueAtTime(-2).split(",").map(Number);
const mW = effect("LineSizer")("Custom Width") == 1 ? effect("LineSizer")("Max Width") : lW[0]|1; // Fallback to 1 to ensure numeric value
const i = textIndex-1;
const s = (mW/(lW[i]|1))*100;
time < 0 ? 0 : (s-100)/19; // Ternary to fix custom width not scaling as it should if there's only one line
As you can see, I went the single-layer route because my goal for this is to work as an animation preset. Having a separate layer made no difference.
Do you have any more thoughts on how to eliminate the glitching? I’ve experimented quite a lot and at this point, I’m running out of options.
I could live with having to update the layer, but if anything else comes to your mind I’m listening 🙂