ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

valueAtTime is not a function

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Remi Monedi
valueAtTime is not a function
on Apr 7, 2020 at 9:14:54 am

Hi everyone,

Is there a way to to make this expression work?

w = effect("Slider Control")("Slider")+1;
w.valueAtTime(time-0.01)


The "+1" is the problem. I guess it is not related to time therefore the ".valueAtTime" can't work with it (this is my guess maybe I'm wrong).
A simple solution would be to add the "+1" at the end of the last line BUT what if you really need this extra value to be taken into account in the "w" variable? And in a single expression (no extra slider created).

Have a nice day!


Return to posts index

Andrei Popa
Re: valueAtTime is not a function
on Apr 7, 2020 at 12:01:04 pm

ValueAtTime only apllies to properties. If you take the value of the slider and add 1, it is an integer. Not a property anymore.
So if the slider is 2 at second 2 and 3 at second 3, you can ask what value it had at which second. But if you add something, let's say at second 2, asking valueAtTime then is like asking what value does 3 have at another second. 3 is 3. Does not change value. That is why you must add it at the last line, where first you ask how big is the slider at given time and then add the number.

If you really need the extra value to be taken into account in the w and not in the last line, you make 2 variables(w plus another one without the "+1"). And use the other one in the last line, then add one.

Andrei
My Envato portfolio.


Return to posts index

Remi Monedi
Re: valueAtTime is not a function
on Apr 8, 2020 at 12:43:20 pm

Thank you for your answer Andrei, it is making much more sense now!
But I'm not sure to understand your solution to let a variable with a property + an integer (like "+ 1") taken into account by valueAtTime? Could you write it?


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]