- May 14, 2018 at 11:39 am
Hello everyone! I just wanted to ask if there is an expression for which an animation starts to work only when another property reaches an established value.
Here it is my problem:
I have three self resizing text boxes (where each boxes is contained in a separated comp, becouse i wanna do an essential graphic template for Premiere).
After the boxes appear, i wanna the text to fill itself sequentially with color, using the range selector. From the first line all the way down to the last line.
—- NOW THE PROBLEM —–
If i give (for example) 1 second to each line of text, the speed of the animation (color fill) will be slightly different for every line, becouse the amount of character/word/lenght will be always different, am I right?
I’m sure there is an expression for this, Can you help me
Thank you so much
- May 14, 2018 at 6:22 pm
I think you’ll want the linear expression hooked up to a expression slider on a null.
The linear expression works by taking one set of values doing the math to interpolate them to another set of values. So, you would want to put this expression on the range selector of each of your text layers
range = thisComp.layer(“YOUR NULL”).effect(“Slider Control”)(“Slider”);
linear(range, 0, 10, 0, 100); // Change the first two numbers to be the keyframed values you want for the slider for each layer
Essentially what this is telling the range selector is “As the null slider goes from 0 to 10, change the range selector value from 0 to 100.
- May 15, 2018 at 9:10 am
Hi, Thank you so much for your help, you made me discover the linear expression, that as I’m seeing is a tremendously useful, but i don’t think that it will solve my problem.
I’ll try to explain myself better, becouse I think that something like the time expression could solve my problem, but tell me if I’m wrong:
As I told you I need to Highlight (fill with color) every text line, sequentialy, one by one. BUT I don’t want to use any keyframe in the composition to trigger each range animations. In other words, I want the range grows from 0 to 100 constantly in time (if the line contains 15 letters it will take more time than a line with 5 letters , for example). So when the first text line reach 100 (as value of the range), this event triggers the animation of the second line, and again when the second text line reach the 10 as value of the range, this event triggers the third animation.
I’m trying with the TIME expression, the only problem is that this kind of expression is linked to the time in composition, so no matter when the event happen, it will always be like the TIME expression started from the first frame of the composition, and the fill is already complite. I need that the constant grow of the range animation can start in any moment.
Thank you so much again, I wait for your answer
I think i’ll need something similar to the time expression, that is not linked at composition time.
- May 15, 2018 at 5:04 pm
Whether you want to use time or a slider value to drive the animation makes little difference.
What the issue is is that with different text lengths you need to adjust the range selector starting and ending points taking into account both the length of the current line AND the combined length of all three lines. You want to progress evenly along the combined length, so you need to know the proportion of the current layer text length to the combined text length to adjust the timing.
So, if you look at the slider value from 0 to 100 (or time value from 0 to 3 for instance, that you can remap to the range of 0-100 (%) with the linear expression), you need to know what the 0 to 100 points for the three consecutive layers are along that time scale.
Let’s take three random values for the line lengths: 15, 9 and 22. The combined length is 15+9+22 = 46. So 46 represents 100(%)
Consequently, the relative points at which the three different lines go from 0 to 100 are 0, 15, 24 and 46. Follow so far?
Turned into percentages — i.e. remapped into the 0-100 range — these points become 0, 15/46*100, 24/46*100 and 100.
Does this help you figure out the expressions?
Senior Graphic Designer
Log in to reply.