Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Affecting multiple keyframes of the same property with different sliders

  • Affecting multiple keyframes of the same property with different sliders

    Posted by Mike Scalisi on December 29, 2019 at 11:45 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"));

    Mike Scalisi replied 6 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 30, 2019 at 5:30 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

  • Mike Scalisi

    December 30, 2019 at 5:45 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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy