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

Remap keyframe timing with slider

Community Beginner ,
Jul 20, 2019 Jul 20, 2019

Copy link to clipboard

Copied

I'm trying to make an Essential Graphics preset for some editors I work with. They have requested control over how long the animation lasts. So I have a text animation where the range is animated with 2 keyframes. I want to control the timeline position of each keyframe independently using sliders. Is there an expression for this?

TOPICS
Expressions

Views

2.3K

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 , Jul 20, 2019 Jul 20, 2019

Something like this, probably:

t1Start = effect("Slider Control")("Slider");

t1End = effect("Slider Control 2")("Slider");

t2Start = key(1).time;

t2End = key(2).time;

t = linear(time,t1Start,t1End,t2Start,t2End);

valueAtTime(t);

Dan

Votes

Translate

Translate
Community Expert ,
Jul 20, 2019 Jul 20, 2019

Copy link to clipboard

Copied

Something like this, probably:

t1Start = effect("Slider Control")("Slider");

t1End = effect("Slider Control 2")("Slider");

t2Start = key(1).time;

t2End = key(2).time;

t = linear(time,t1Start,t1End,t2Start,t2End);

valueAtTime(t);

Dan

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 ,
Jul 20, 2019 Jul 20, 2019

Copy link to clipboard

Copied

Thanks, That did the trick

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 ,
Nov 28, 2021 Nov 28, 2021

Copy link to clipboard

Copied

Thanks so much for this, Dan.

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 ,
Jan 21, 2022 Jan 21, 2022

Copy link to clipboard

Copied

Hi Dan, would this be possible with 4 keyframes?

 

I have an animated precomp with an "animate-in" range (first two keyframes) and an "animate-out" range (3rd and 4th keyframes).

 

Ideally, I'd be able to control the second keyframe and the third keyframe so I can extend or compress the animation

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 ,
Jan 21, 2022 Jan 21, 2022

Copy link to clipboard

Copied

Try this:

t2 = effect("Slider Control")("Slider");
t3 = effect("Slider Control 2")("Slider");
if (time < t2){
  t = linear(time,key(1).time,t2,key(1).time,key(2).time);
}else if (time < t3){
  t = linear(time,t2,t3,key(2).time,key(3).time);
}else{
  t = linear(time,t3,key(4).time,key(3).time,key(4).time);
}
valueAtTime(t)

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 ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

Is there a way to make this work in Premiere in the Essential Graphics section?
My animation just ignores the sliders.

 

 

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 ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

Nevermind, it worked after changing Premiere to english.

 

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 ,
Jul 02, 2022 Jul 02, 2022

Copy link to clipboard

Copied

Hey @rheinklangmedia - any chance you'd be willing to share the mogrt you have working in premiere? I'm really more of a tinkerer so I think I need to get my hands on a working example to make it work for my own context. If anyone is curious I'm trying to create a dynamic-caption-generator mogrt that allows for timing the specific words with a slider.

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
Explorer ,
May 30, 2023 May 30, 2023

Copy link to clipboard

Copied

thanks Dan, but how else to add a loop to this expression? for example, I have a looped animation, but I want to change the position of a keyframe in the timeline to speed up or slow down the animation to add it to Essential Graphics. I just added loopOut(); at the end of your expression. but it didn't work.

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 ,
May 30, 2023 May 30, 2023

Copy link to clipboard

Copied

You'd have to create your own loop. If you're talking about the first expression, you could do it like this:

t1Start = effect("Slider Control")("Slider");
t1End = effect("Slider Control 2")("Slider");
t2Start = key(1).time;
t2End = key(2).time;

t = time > t1End ? t1Start + (time - t1End)%(t1End - t1Start) : time;
tNew = linear(t,t1Start,t1End,t2Start,t2End);
valueAtTime(tNew);

 

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
Explorer ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

Dan, you are a genius. Thank you very much. I'm just learning AE, and just recently learned the expression section of my tutorial. I would like to understand what mathematical calculations you indicated in this expression, but I do not understand. This expression worked for, but I don't even see loopOut("cycle"); in your expression. but it works. I'm delighted 🙂 I have so many questions left, is it possible to personally contact you somehow? Or I can create a thread here, and send the thread link to you so you can give a clue to a newbie like me. For example, I'm having trouble importing AI files into After Effects:

https://community.adobe.com/t5/after-effects-discussions/ai-layer-resizes-1-pixel-more-when-imported...

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 ,
May 31, 2023 May 31, 2023

Copy link to clipboard

Copied

If you add loopOut() to an expression, it doesn't loop your expression, it replaces whatever your expression has done so far with its own, normal, loopOut() calculation based on keyframes. So you need to cook up your own version of the loopOut math, which is what my expression does.

People do contact me directly (you can send me a message through this site, or contact me through my web site) but my AE knowledge is pretty much focused on expressions and scripting, so for general AE questions you're probably better off posting them in this forum.

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
Explorer ,
Jun 02, 2023 Jun 02, 2023

Copy link to clipboard

Copied

Dan, please excuse me for impudence, but please tell me how to make an expression like with a loop like the previous example, but with the type loopOut("pingpong"). I tried to tweak your past expression somehow with a regular loop, but I'm still stupid for that 😞
Also, could you show the expression with the usual loopOut("cycle") as in the previous example, but with 3 three keyframes, so I can theoretically also call like "pingpong" but with more customizable charts. Sorry if I write a little incomprehensibly, I use a translator.

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 ,
Jun 02, 2023 Jun 02, 2023

Copy link to clipboard

Copied

LATEST

That takes a little more code, so something like this probably:

t1Start = effect("Slider Control")("Slider");
t1End = effect("Slider Control 2")("Slider");
t2Start = key(1).time;
t2End = key(2).time;

if (time > t1End){
  seg = Math.floor((time - t1End)/(t1End - t1Start));
  phase = (time - t1End)%(t1End - t1Start);
  t = seg%2 ? t1Start + phase : t1End - phase;
}else{
  t = time;
}
tNew = linear(t,t1Start,t1End,t2Start,t2End);
valueAtTime(tNew);

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