Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions valueAtTime is not a function

  • valueAtTime is not a function

    Posted by Remi Monedi on April 7, 2020 at 9:14 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!

    Remi Monedi replied 6 years ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    April 7, 2020 at 12:01 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.

  • Remi Monedi

    April 8, 2020 at 12:43 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?

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy