Skip to main content
Inspiring
May 19, 2025
Open for Voting

Set a keyframe with the pre-expression value

  • May 19, 2025
  • 14 replies
  • 905 views

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😊.

14 replies

Community Expert
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.

David.Arbor
Community Manager
Community Manager
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, 

Inspiring
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🌹.

David.Arbor
Community Manager
Community Manager
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