ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: Expression value to a keyframe

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Alex Printz
Re: Expression value to a keyframe
on Mar 7, 2019 at 4:31:33 pm

You cannot push values into keys, only pull. You would do like this:


t1 = key(1).time;
t2 = key(2).time;

v1 = 0;
v2 = thisComp.layer("control").effect("example")("example");

linear(time,t1,t2,v1,v2)


note that you cannot adjust the curves with this; you are only looking at when these keys are set.


If you want to be able to adjust the slope, set the keys to have different property values (e.g, Key 1: 100, key 2:200), and try this:


p1 = key(1).value;
p2 = key(2).value;

v1 = 0;
v2 = thisComp.layer("control").effect("example")("example");

linear(value,p1,p2,v1,v2)


Note this second expression depends on the keys having different input property values and understanding that your property is going to convert the change in property values into a similar change between your two defined values!

Alex Printz
Mograph Designer


Posts IndexRead Thread 


Current Message Thread:





© 2019 CreativeCOW.net All Rights Reserved
[TOP]