Highlighted

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

Community Beginner ,
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

 

Adobe Community Professional
Correct answer by Rick Gerard | Adobe Community Professional

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

TOPICS
Error or problem, Expressions, How to

Views

240

Likes

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

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

Community Beginner ,
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

 

Adobe Community Professional
Correct answer by Rick Gerard | Adobe Community Professional

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

TOPICS
Error or problem, Expressions, How to

Views

241

Likes

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
Apr 15, 2020 0
Adobe Community Professional ,
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.

Likes

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
Reply
Loading...
Apr 16, 2020 0
Community Beginner ,
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

Likes

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
Reply
Loading...
Apr 23, 2020 0
Adobe Community Professional ,
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.

Likes

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
Reply
Loading...
Apr 23, 2020 0
Community Beginner ,
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?

 

Likes

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
Reply
Loading...
Apr 23, 2020 0
Adobe Community Professional ,
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

Likes

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
Reply
Loading...
Apr 24, 2020 2
Community Beginner ,
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

Likes

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
Reply
Loading...
Apr 25, 2020 0
Community Beginner ,
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 

Likes

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
Reply
Loading...
Apr 26, 2020 1
New Here ,
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).

Likes

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
Reply
Loading...
Sep 22, 2020 1
Community Beginner ,
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

Likes

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
Reply
Loading...
Sep 22, 2020 0