• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Time control expression of layer with slider for use with a MOGRT

Community Beginner ,
Apr 15, 2020 Apr 15, 2020

Copy link to clipboard

Copied

Hi I'm very new to expressions and trying to create an expression to a slider in After effects that will control when a text will appear.

An example would be for a dot point that is timed to when speakers says that point.

So I could have a text animation that is delayed until a certain point in time that is controlled by the slider.

I found something close with Evan Abrahams, but can't get it to gel.

 

On=thisComp.layer("Controls").effect("Text on")("Slider")
x=value[0]+easeIn(time,On,0,122);
y=value[1];
[x,y]

 

Thansk to anyone that might be able to help

Phil

 

TOPICS
Error or problem , Expressions , How to

Views

4.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 24, 2020 Apr 24, 2020

I think your basic approach is flawed. I would set up multiple text layers in After Effects and add a Null to the top of the stack with a bunch of Effects Control Sliders. One for fade in time and the others for layer start times. If you added the Fade Up Lines animation preset that comes with AE to the text layer and then added this expression to the Start property of the Range Selector you could set the start time and fade up time for as many text layers you would want to add to the template.

...

Votes

Translate

Translate
Community Expert ,
Apr 16, 2020 Apr 16, 2020

Copy link to clipboard

Copied

I think your approach is flawed. I would create a project that has a text layer fade in and out based on the layer in and out points like so many of the MOGRT's that are included in the presets in Premiere Pro. Then you just use drop the MOGRT in the timeline, edit the text, and adjust the timing and the in and out points to reveal your bullet points. There are already several presets that do that in Premiere Pro.

 

Adding a slider to control the visibility of a layer in Premiere to reveal bullet points is still going to require you to edit the start and endpoint of the layer to change the text.

 

On the other hand, if you have a list:

  • First point
  • Second point
  • Third Point

You would not want to control the visibility of the layer but you would use the slider to control text animators that fade in the text layer a line at a time. If that is your intention, please let us know. It's pretty easy to add an Expression Control Slider a text layer and then add the existing Animate>Presets>Text>Animate In>Fade Up Lines preset and link the slider to the Range Selector>Start property. You would not even have to delete the keyframes. That should be all you need to do.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 23, 2020 Apr 23, 2020

Copy link to clipboard

Copied

Hi Rick,

Thanks so much for taking the time to reply. I think you hit the nail on the head with your suggestion, which like you suggested was pretty easy to do, however I'm still faced with the problem of controlling when it appears in Premiere.

I'm thinking there must be an offset vaule in there somewhere that allows me to drag a slider and delay the entry of the point. so first point would come in after 6 seconds, theb second point slider would allow me to offset to 10 seconds and so on.

What do you think?

Thanks Phil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 23, 2020 Apr 23, 2020

Copy link to clipboard

Copied

You still need to start with the inPoint of the layer, not the time. Only then can you control the delay in the next line of text.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 23, 2020 Apr 23, 2020

Copy link to clipboard

Copied

Thanks Rick, sorry I can't quite figure out what you mean, attach a slider control to the inpoint?

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 24, 2020 Apr 24, 2020

Copy link to clipboard

Copied

I think your basic approach is flawed. I would set up multiple text layers in After Effects and add a Null to the top of the stack with a bunch of Effects Control Sliders. One for fade in time and the others for layer start times. If you added the Fade Up Lines animation preset that comes with AE to the text layer and then added this expression to the Start property of the Range Selector you could set the start time and fade up time for as many text layers you would want to add to the template.

 

 

 

frames = 1/thisComp.frameDuration;
fadeTime = thisComp.layer(1).effect("Fade Time")("Slider")/frames;
startTime = thisComp.layer("Controller").effect(index)("Slider");
if (time <= startTime)
	0
else 
	ease(time - startTime, 0, fadeTime, 0, 100);

 

 

 

Using direct references instead of layer names makes it easy to apply this expression to any number of text layers and as long as there is a start time slider for each text layer you won't run into any errors.

 

That would be just the start of a useful MOGRT. Here's what a few minutes work with this expression looks like:

Screenshot_2020-04-24 04.17.00_Uo07iv.png

TextAnimator.gif

There are still a lot more things to add to the Graphics Template to make it useful. If you are familiar with the workflow required to complete a MOGRT you should not have much trouble turning this expression and a text animator into something useful.

 

You could also add similar expressions to control the position of each layer, set the fade-out time of one layer based on the fade-in time of another turn it into something that might be very useful. 

 

Just for fun, I saved the project file and the Mogrt - Both are only a starting point to help you figure out how to proceed.

Fade In Four Line.MOGRT

Line by Line MOGRT.AEP

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 25, 2020 Apr 25, 2020

Copy link to clipboard

Copied

Hi Rick, I can't thank you enough, this is a complete game changer, it is a massive speed up in my workflow, and I have been able to apply the concept to other MOGRT files as well. And most impoirtantly learnt a lot more about expressions beyond the basic controls.

Thank you so much! Phil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 26, 2020 Apr 26, 2020

Copy link to clipboard

Copied

Rick I had to report back on how well your code has worked! I created my on file based on your orginal file and added to my project and it was seamless, didn't have to jump into after effects or create a dynamic link, was able to follow the presenter and add the dot points as he said them and make it all look very presentable!

Thanks so much for taking the time to help! You are a true gentleman!

Ive added my version for your records.

Thansk again Phil

 https://www.dropbox.com/s/fuixbavhicsbl62/6%20lines%20points.mogrt?dl=0 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 22, 2020 Sep 22, 2020

Copy link to clipboard

Copied

In regard to the script Rick provided above and based on how the linear and ease functions are defined, a more intuitive way of defining the interpolation seems to be the following:

 

frames = 1 / thisComp.frameDuration;
fadeTime = thisComp.layer(1).effect("Fade Time")("Slider") / frames;
startTime = thisComp.layer("Controller").effect(index)("Slider");
ease(time, startTime, startTime + fadeTime, 0, 100);

 

Using the interpolation functions this way allows removing the if-then-else block entirely because both the linear and ease functions, when used with five parameters, can take care of that case (i.e. when time is less than starTime, the output is always equal to the fourth value passed to the function, in this case 0).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 22, 2020 Sep 22, 2020

Copy link to clipboard

Copied

Hi Luigi,

really appreciate you taking the time to reply, just gave it  quick go and it works well!

Thansk again Phil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 29, 2023 Apr 29, 2023

Copy link to clipboard

Copied

Very nice! But this is just for 'fading in' text at certain point!

 

I have 4 text layers that move in from bottom (out of frame) to the middle.
The client wants to control the timing. Sometimes they need to animate seperate with a delay. Sometimes text1 and text2 need to animate in together.  Is there a way to also get a slider that controls when a layer stars moving or rotating ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 29, 2023 Apr 29, 2023

Copy link to clipboard

Copied

LATEST

"You could also add similar expressions to control the position of each layer, set the fade-out time of one layer based on the fade-in time of another turn it into something that might be very useful. "

 

could you make an example .aep please?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 14, 2023 Apr 14, 2023

Copy link to clipboard

Copied

I would up using a time delay function: 

var delay = comp("esign1").layer("Essential Graphics Main Text Controls").effect("Line2 Fade On")("Slider"); // seconds
valueAtTime(time - delay)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines