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

Set a keyframe with the pre-expression value

Explorer ,
May 19, 2025 May 19, 2025

Hello, when I used expression in my workflow, I want to set a keyframe value for the pre-expression(after caluculation) value.
so I used to see the value by eye and then type it.
I was wonder why something like this isn't a built-in feauter in after effects.

I know that it can be done using scripts, but I think it is essential to be a built-in feature.
some recommandation for how it can be implemented.
ctrl + (click on add keyframe button, or the stopwatch).
or any place where it is near to the add keyframe button.

Thanks for reading😊.

Idea No status
TOPICS
Expressions , Workflow
717
Translate
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
13 Comments
Adobe Employee ,
May 19, 2025 May 19, 2025

Hi @ahmed hamed elsaid

 

Could you clarify what you mean when you say you want to set a keyframe value for the pre-expression (after calculation) value? The pre-expression value would inherently be before calculations, so can you give me a specific example of what you would like to do?

 

Also, I'm not sure if this is what you're looking for, but if you add the term value in your expression, that represents the pre-expression value.

 

For example, if you have a several circles that are at different scale values, but you want to increase all of their values by using a single slider, you can use the expression value + [slider] . If you just pick whip to the slider, then your pre-expression value gets overwritten, but if you add value then it takes into account the pre-expression slider.

 

Thanks,
- David, After Effects Engineering Team

Translate
Report
Explorer ,
May 19, 2025 May 19, 2025

@David.Arbor 
I am very sorry !
I meant Post-expression(after applying the expression)
Here is an example.

lets say the property before keyframe is is 1.
after applying an expression => 
=====
2*value+5
=====
the property becomes 7.
when I make a new keyframe, it dosen't care about the calculated value, so the added keyframe will be 1.
there is no way to make a keyframe with the value 7, except copying it, which can be hard for many properties!
It is similar to baking the expression, but just for one keyframe that is the added one.
this is the thing that I am suggesting😊.
if there is still something that isn't clear, I here:rose:.

Translate
Report
Adobe Employee ,
May 19, 2025 May 19, 2025

Ah, I see what you're looking for. The challenge here is that expressions affect the entire property stream, not individual keyframes (although expressions on keyframes would be an awesome feature); so you're correct that what you're after isn't possible. There is, however, a way to access the post-expression value, and that's to pick whip something else to the value. If you pick whipped a slider to your property, it would read "7," and not "1." 

 

The scenario you're looking for wouldn't make a lot of sense because then it becomes a question of what is the expression affecting? It can't both generate a value of "7" and then apply the expression on itself again, that would great an endless growth of values that would almost certainly not get what you want.

 

Perhaps if I understood more about your workflow and what specifically what you wanted this feature for, I could help guide you toward an alternate solution. 

 

-David, After Effects Engineering Team, 

Translate
Report
Community Expert ,
May 19, 2025 May 19, 2025

You can use valueAtTime() instead of typing in or copying the value. I need to see one of your expressions in a timeline to give you the exact code, but I use variations on this kind of coding in many of my animation presets. It's very common.

Translate
Report
Explorer ,
May 20, 2025 May 20, 2025

@David.Arbor 

I use it when linking some properties and then want to get some values at different times witht the expression effect for one of them, and then remove the expression after that.
so I can control the speed and adjust values as I want.

Translate
Report
Explorer ,
May 20, 2025 May 20, 2025

@Rick Gerard 
I don't think you got my suggestion

Translate
Report
Explorer ,
May 20, 2025 May 20, 2025

lets give another example.
I animated some cube in the y position. (say it is cube 1)
Then, made another cube.(cube 2)
linked the x position of cube 2 with the y of cube 1.
Now I want only to get the start and the end of the cube 2's position, so I can control the easing bettween them.
but for doing this, I have to copy the values and paste them.
the method of linking another slider with it to get the post expression can work here.
but there is some properties that is tricky to do, like paths.
also this method is slow.
And I think it is not complicated to implement in aftere effects, right?😂👌

Translate
Report
Adobe Employee ,
May 20, 2025 May 20, 2025

Thanks for that explanation; I believe I see what you're after now. What you would like would still cause significant problems simply because expressions overwrite an entire property, so you could never pull a post-expresion value as a keyframe while still having an expression applied. However, in the last example you gave, unless I'm misunderstanding, there's a very simple solution.

  • After you linked the Cube 2's xPosition to Cube 1's yPosition, you have the desired post-expression value.
  • Simply create a new keyframe on Cube 2's xPostion, click on the xPosition value to edit it. and enter the exact same value you already see in red text.
  • Go to the next place you want a keyframe and again, type in the same post-expression value you want.
  • Nothing will have changed in the Comp panel because the expression is overwriting the property, but when you remove the expression, you'll be left with two keyframes with your desired values.

 

- David, After Effects Engineering Team

Translate
Report
Explorer ,
May 20, 2025 May 20, 2025

@David.Arbor 
I know that nothing will change if the expression is still enabled or doesn't use the current keyframe value inside the expression.
but after I make this keyframe I will disable the expression so I only wanted to get the value after the calulation.
I can copy the values in the red text like you said, but it gets tricky for some properties like the path for example.
it will be really easy and open the gate for some great techniques to animate faster if there is something like this for aftere effects, specialy when you want to do the same thing for more than one property! 

Translate
Report
Adobe Employee ,
May 20, 2025 May 20, 2025

It definitely would open the door to some convient workflows, and I myself have definitely wanted this on more than one occasion in my 15 years of working with After Effects. You're right, of course, that this doesn't work for Path properties, as those are somewhat unique.

 

- David, After Effects Engineering Team

Translate
Report
Explorer ,
May 20, 2025 May 20, 2025

@David.Arbor Thank you😊.
And I hope to see this in the next versions of after effects.
reminder ->
  some recommandation for how it can be implemented.
  ctrl + (click on add keyframe button, or the stopwatch).
  or any place where it is near to the add keyframe button.


Translate
Report
Explorer ,
May 26, 2025 May 26, 2025

I'm not sure this script will solve your problem directly but it might help

 

The script has two buttons:

prop_offset_gui.jpg

 

[KEYS -> EXP]: Bake the property's Keyframes & Expression into the Expression only

[EXP -> KEYS]: Bake the property's Keyframes & Expression into the Keyframes only (like the built-in function)

 

It's pretty straight forward in how it works. You can download it here. I use it a lot to offset tracking data rather than parenting the property to a temporary parameter.

 

I hope it actually helps.

 

Mike

Translate
Report
Explorer ,
May 28, 2025 May 28, 2025
LATEST

@MikeSevigny Thats a very cool script!
But that is not what I meant to say here, try to read the example I wrote here maybe it will help.
the main thing is to get the keyposes that you get from expresssion for different time, and then you can get rid of the expression.
if it is built in feature it will be a very helpfull thing.

Translate
Report