-
Extendscript replacement for the “velocityAtTime” function in AE expressions?
I was making small changes to the bounce expression below in order to call it in extendscript:
Realistic Bounce and Overshoot (motionscript.com)
About 10 lines down we see:
v = -velocityAtTime(key(n).time – .001)*e;
According to the expressions documentation the velocityAtTime function lives on the property object: Property — After Effects Expression Reference 0.0.3 documentation (docsforadobe.dev)
However, according to the scripting guide, there is no velocityAtTime function:
Property object — After Effects Scripting Guide 22.3.0 documentation (docsforadobe.dev)
Am I overlooking something or should I write this function myself? For further context, it looks like expressions have access to a variable space that is different from extendscript. e.g. I can call “numKeys” in an expression by itself but in extendscript I need to specify the comp -> layer = > property. This makes sense as an expression is “attached” to an existing property while an extendscript function exists in the global context.
Thanks for any help you can provide!