ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Affecting multiple keyframes of the same property with different sliders

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mike Scalisi
Affecting multiple keyframes of the same property with different sliders
on Dec 29, 2019 at 11:45:38 pm

I have an animation where a text layer moves from left to right a 3 times, each time pulling a different word from the edge of the screen and then centering. I want to make this a MOGRT file so user can change the text later on. Changing the text will require the text to be re centered. I created a slider control to add or subtract from the value of the x position for each word. I used this expression successfully to change the centering on the first set of words:

linear(time, key(3).time, key(4).time, value, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("1st TEXT CENTER ADJUSTMENT")("Slider"));

linear(time, key(5).time, key(6).time, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("1st TEXT CENTER ADJUSTMENT")("Slider"), value);

But when I tried to do it for the next set of keys (7,8,9,10) which are liked to a different slider. It cancels out the first expression. Here is what I tried to add on:

linear(time, key(7).time, key(8).time, value, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("2nd TEXT CENTER ADJUSTMENT")("Slider"));


linear(time, key(9).time, key(10).time, value, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("2nd TEXT CENTER ADJUSTMENT")("Slider"));


I know I'm just missing something. Here is a screen grab of my timeline



and a link to the original animation I'm trying to make a template out of:

https://www.dropbox.com/s/1dfpenxylmsnv3e/sample.mp4?dl=0

linear(time, key(3).time, key(4).time, value, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("1st TEXT CENTER ADJUSTMENT")("Slider"));

linear(time, key(5).time, key(6).time, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("1st TEXT CENTER ADJUSTMENT")("Slider"), value);

linear(time, key(7).time, key(8).time, value, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("2nd TEXT CENTER ADJUSTMENT")("Slider"));

linear(time, key(9).time, key(10).time, value, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("2nd TEXT CENTER ADJUSTMENT")("Slider"));



Return to posts index

Dan Ebberts
Re: Affecting multiple keyframes of the same property with different sliders
on Dec 30, 2019 at 5:30:03 pm

You need to make sure that only one of those statements gets executed at any given frame. Something like this (not tested):


if (time < key(5).time){
linear(time, key(3).time, key(4).time, value, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("1st TEXT CENTER ADJUSTMENT")("Slider"));
}else if (time < key(7).time){
linear(time, key(5).time, key(6).time, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("1st TEXT CENTER ADJUSTMENT")("Slider"), value);
}else if (time < key(9).time){
linear(time, key(7).time, key(8).time, value, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("2nd TEXT CENTER ADJUSTMENT")("Slider"));
}else{
linear(time, key(9).time, key(10).time, value, value+comp("OUTRO 3 TEXT HITS").layer("TEXT CENTER CONTROLS").effect("2nd TEXT CENTER ADJUSTMENT")("Slider"));
}



Dan



Return to posts index

Mike Scalisi
Re: Affecting multiple keyframes of the same property with different sliders
on Dec 30, 2019 at 5:45:57 pm

That was the piece I was missing! Took a little tweaking to the last line most likely because I forgot to switch the output min and max in my original post but after switching those it worked perfect and i was able to recreate for my third slider. You are the man!I


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]