Skip to main content
Known Participant
April 16, 2020
Answered

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

  • April 16, 2020
  • 3 replies
  • 7407 views

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

 

Correct answer Rick Gerard

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:

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

3 replies

chrisb60245470
Participant
April 14, 2023

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)

Rick GerardCommunity ExpertCorrect answer
Community Expert
April 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.

 

 

 

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:

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

Known Participant
April 26, 2020

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

Community Expert
April 16, 2020

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.

Known Participant
April 23, 2020

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

Community Expert
April 24, 2020

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.