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

Link a keyframe to slider control without affecting other keyframes

New Here ,
May 24, 2018 May 24, 2018

Copy link to clipboard

Copied

I'm designing a lower third for one of our brands and have an animated object with 3 keyframes.

I need to link the 3rd keyframe to a slider so my team can eventually adjust that value in Premiere with essential graphics without affecting the other keyframes.

What expression should I use to do this?

I imagine it would look something like this (with better syntax):

if ( key(index) = 3 ) {

key(index).value = effect("Slider Control")("Slider");

}else

key(index).value = value

TOPICS
Expressions

Views

8.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
Explorer ,
Jun 13, 2018 Jun 13, 2018

Copy link to clipboard

Copied

Has anyone figured out a solution for this? I'm doing the same thing, only I want to link a specific keyframe to a sourceRectAtTime() for the lower third text layer.

Thanks.

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
Guide ,
Jun 16, 2018 Jun 16, 2018

Copy link to clipboard

Copied

Almost right. You'll need a Linear expression in there to convert values. Here's a solution that will allow you to control the KF between 0 and the slider value, courtesy of the brilliant Dan Ebberts;

if (numKeys > 1){

t1 = key(1).time;

t2 = key(2).time;

v1 = 0;

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

linear(time,t1,t2,v1,v2);

}else value

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 ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

I like this expression,

But what can I do to link more than 2 keyframes to sliders?

Key1= slider1; key2=slider2; key3=slider3

etc.

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 ,
Mar 05, 2021 Mar 05, 2021

Copy link to clipboard

Copied

I'm able to make this work with 2 keyframes but not with anymore than that.

What happens if you have an in and out movement and you want to control both? 

I've tried adding 

t3 = key(3). time;

t4 = key(4). time;

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

linear(time,t1,t2,t3,t4,v1,v2,v3,v4);

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

linear(time,t1,t2,t3,t4,v1,v2,v3,v4);

But it's not working.

For context; I need these keyframes to be controlled with a slider so that I can make the motion editable in Premiere Pro

Any help would be super appreciated.

Thanks

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 ,
Mar 06, 2021 Mar 06, 2021

Copy link to clipboard

Copied

Try replacing your last line with this:

if (time < t2)
  linear(time,t1,t2,v1,v2)
else if (time < t3)
  linear(time,t2,t3,v2,v3)
else
  linear(time,t3,t4,v3,v4)

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
Participant ,
Aug 04, 2021 Aug 04, 2021

Copy link to clipboard

Copied

yeah, it works

 

if(numKeys>1){
 
t1 = key(1).time;
t2 = key(2).time;
t3 = key(3).time;
t4 = key(4).time;
v1 = 0;
v2 = thisComp.layer("Comandos").effect("Comprimento")("Slider");
v3 = v2;
v4 = v1;
 
if (time < t2){
easeOut(time, t1, t2, v1, v2);
} else {
if(time < t3){
ease(time,t2, t3, v2, v3);
}else{
easeIn(time, t3, t4, v3, v4);
}
}
}else value
 

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 ,
Aug 23, 2022 Aug 23, 2022

Copy link to clipboard

Copied

Is there a good way to control the easing using this method? Or can the keyframes not take on the easing information from the keyframes because it has an expression?

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
Participant ,
Aug 23, 2022 Aug 23, 2022

Copy link to clipboard

Copied

LATEST

Not sure how to do this, sorry

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 08, 2022 Apr 08, 2022

Copy link to clipboard

Copied

Hi Angie,

 

I made good use of a version of this expression to control a slider when the first keyframe is used on a property of a layer located right at the start of the comp. I am aiming to control the 2nd keyframe on a property with a slider in my case.

if (numKeys > 1){

t1 = key(1).time;

v1 = effect("Y Scale Offset (last KF)")("Slider")*0.6;

linear(time,t1,v1);

}else value


However I would like to make use of an expression which works in the same way when the layer starts halfway along the timeline? Is this possible? Do I need to replace the "time" function with something else?

Thanks

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