-
If/else + linear expression with variables
Hi guys, I’ll do my best to make it as clear as possible.
I built a system of 3 text boxes. Whenever the layer value (“Text”. Text.sourceText.length) of one of these is equal to 0 (so there are no characters), each line disappears, and then all the system is always auto-centered.
Watch this video to understand
https://www.dropbox.com/s/zahkzuicfe3fxga/If%3Aelse%2Blinear-expression_tex-boxes.mov?dl=0As you see at the end of this short video, the three text boxes are linked to a null object where there is a slider control with a linear expression, this one:
src = effect(“Slider Control 2”)(“Slider”);
linear(src, 1, 3, -267, 258);which can move the whole system in three positions: up, center and down.
The problem is that the movement the slider has to make to respect the same margins (the red ones) with 1 line of text, 2 lines of text or 3 lines of text, changes each time, depending on how many text boxes are active, because the shift the slider has to do, is different.
So i would love to see the slider work from position 1 to 3, differently, depending on these variables:
(I’ll try to write them down in non-expression language)If characters of text line 3 > 0 —-> linear (src,1,3,a,a)
but If characters of text line 3 = 0 —-> linear (src,1,3,b,b)
but If characters of text line 3 and 2 = 0 —-> linear (src,1,3,c,c)Hope This is clear. I think the expression is hard, so thank you so much in advance for your help
Aniello
Aniello Ferrone
Viral Video Editor
http://www.fanpage.it