Skip to main content
Participant
November 23, 2014
Answered

Accessing original value of a property before an expression is applied

  • November 23, 2014
  • 2 replies
  • 976 views

I have a layer, which has an expression applied to Position. The expression changes the Position value over time. What I am trying to do is access the value of Position as if it had no expression applied to it. The property("Position").value method doesn't work because it takes current Position value which is influenced by the expression. What I need is the original value. Is there any way to get that?

Correct answer Dan Ebberts

Are you trying to do this with a script or expression?

With a script you just use .valueAtTime(time,preExpression) with preExpression set to true;

It's trickier with an expression but, if the pre-expression value is static, you can use "negative time". In the expression you do something like this:

if (time < 0){

  value

}else{

  // your real expression goes here

}

Then your other expression could do something like this:

your_property.valueAtTime(-1)

If the pre-expression value is not static, it's a little more complicated, but you can still do it.

Dan

2 replies

Inspiring
July 23, 2025

hey, I know that this is so old like a decade.
but there is a better solution for static and non-static properties.
so solution is simillar to the negative, but the negative method fails when using non-static property(has keyframes).
so I add a small time when passing it to the valueAtTime(t), and know by it if I want the original or not.
lets give an example:-
var dt = thisComp.frameduration/100;
//for getting the pre-expression value of this property, we use property.valueAtTime(time+dt) for calling the pre-expression value in another property
if( (time%dt)toFixed(4) ==dt.toFixed(4)){

    value

}else{

    //here is your original expression

}
I don't know if can be any inaccuracy error (rounding) or not, but I tried it and it worked.
until adobe adds a way to read influence values for keyframes.
then it will be a lot easier.

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
November 23, 2014

Are you trying to do this with a script or expression?

With a script you just use .valueAtTime(time,preExpression) with preExpression set to true;

It's trickier with an expression but, if the pre-expression value is static, you can use "negative time". In the expression you do something like this:

if (time < 0){

  value

}else{

  // your real expression goes here

}

Then your other expression could do something like this:

your_property.valueAtTime(-1)

If the pre-expression value is not static, it's a little more complicated, but you can still do it.

Dan

Participant
November 23, 2014

I didn't realize it was so easy! Probably looked at the wrong places. Thanks a lot! I am scripting, btw.