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

Is there a way to change expression values per keyframe?

Explorer ,
May 19, 2015 May 19, 2015

Copy link to clipboard

Copied

I'm using an bounce/overshoot expression on the position property of an animated element.  On big moves, I want the bounce value to be higher - but on smaller movements I don't want it so dramatic.  It seems like the expression is independent of the keyframes - and if change a variable in the expression it changes it for the entire timeline - vs just certain keyframes.  Is this possible?

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 , May 20, 2015 May 20, 2015

You can also use ExpressionTimeline to combine several instances of your expression with different parameter settings.#

Here is a tutorial showing how to use ExpressionTimeline:

tutorial-thumbnail-expression-timeline.jpg?itok=Gid_PJPb

Limit Expressions to a Range of Keyframes with Expression Timeline | mamoworld

Votes

Translate

Translate
LEGEND ,
May 19, 2015 May 19, 2015

Copy link to clipboard

Copied

It depends on your expression and how it's written.

For stuff like this, I'll often make some of the numbers in an expression be variables which are tied to Expression Control effects.

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 19, 2015 May 19, 2015

Copy link to clipboard

Copied

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 19, 2015 May 19, 2015

Copy link to clipboard

Copied

Dan - its your script on that page that I'm actually using! It's great...  But Maybe I'm not implementing it correctly.   How can i change the values per keyframe vs the timeline as a whole?

ae-expressions.jpg

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 19, 2015 May 19, 2015

Copy link to clipboard

Copied

I suppose you could create frequency and decay arrays, with entries for each keyframe and modify the expression to something like this:

freqArray = [3,2,1,4];

decayArray = [5,6,7,6];

n = 0;

if (numKeys > 0){

  n = nearestKey(time).index;

  if (key(n).time > time) n--;

}

if (n > 0){

  freq = freqArray[Math.min(n-1,freqArray.length-1)];

  decay = decayArray[Math.min(n-1,decayArray.length-1)];

  t = time - key(n).time;

  amp = velocityAtTime(key(n).time - .001);

  w = freq*Math.PI*2;

  value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w);

}else

  value

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
Engaged ,
Feb 02, 2021 Feb 02, 2021

Copy link to clipboard

Copied

LATEST

First, I want to thank @Dan Ebberts  and @Mathias Moehl  for their long lasting contributions to this community! We all stand on your shoulders...

Alternately, if you are someone like myself with tonnes of AE/compositing experience, but not a deep/real understanding of expressions, you could use one value, like a slider, as an animated multiplier.

I've been scouring the web for a way of transitioning from one position (user controlled via a mogrt in Premiere), to another predetermined position. I had been thinking keyframes, which was breaking my brain, until I remembered this old trick of "fading" the intensity of a value by multiplying it by 1 or 0.
Multiplier slider.PNG
What I like about this method, is that it gives the dynamics controls back to a user who is comfortable in the graph editor, giving traditional animation tools back to the AE user to help shape the intimidating expression for their needs.

In the hopes that this is helpful to the odd ones out there who may be in a similar position to myself:
I created a controls layer and added a Point Control and Slider effect, under expression controls.

On the layer you want to apply the "fade/transition" to a property, in this case X position (separated to X,Y), paste this expression in to the value:

 

BASE_X = transform.xPosition;

U_OFFSET = thisComp.layer("Controls").effect("Point Control")("Point")[0];

FADE = thisComp.layer("Controls").effect("TRANSITION")("Slider");

[BASE_X+(U_OFFSET*FADE)]


Here is a screen grab of the comp.
Fade offset value.PNG

 

Fade-offset-position-test.gif


Ive used this before for creating transition animations on expression driven graph heights, and its useful for anything you can imagine a multiplier working on... combine with Linear. to remap from one type to another.

I hope this is helpful to someone!
David









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 20, 2015 May 20, 2015

Copy link to clipboard

Copied

You can also use ExpressionTimeline to combine several instances of your expression with different parameter settings.#

Here is a tutorial showing how to use ExpressionTimeline:

tutorial-thumbnail-expression-timeline.jpg?itok=Gid_PJPb

Limit Expressions to a Range of Keyframes with Expression Timeline | mamoworld

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects

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 20, 2015 May 20, 2015

Copy link to clipboard

Copied

Yes - this is exactly what I was looking for. Thank you!

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