Page 1 of 1

Automatically-Calculated Keyframe

PostPosted: 07/7/2015, 9:09 am
by Minh
May I have a question:
Can we do some kinds of expressions which can directly affect the value of a keyframe
For example, I have may layer and their scales are depended to the value of a slider control. I want to animate them from 0% to the percentage which is linked previously to my control. Is there anyway that the value of the keyframes changes dynamcally relating to the one of the slider control.

Sorry if it sounds confusing, and I'd be glad to receive any answer.

Thank you

Re: Automatically-Calculated Keyframe

PostPosted: 07/9/2015, 1:11 pm
by Michael_Szalapski
You can use value in your expression. That will reference the keyframe. So, if your expression says value*2 and your keyframes go from a value of 2 to 10, the result will go from 4 to 20.

Re: Automatically-Calculated Keyframe

PostPosted: 07/9/2015, 9:33 pm
by Minh
Hi Michael_Szalapski,
Thank you but that is not really what I meant. For example,
I want to link the opacity from several layers to the slider control on another one named "Control" valued 100, I'll type the expression:

thisComp.layer("Control").effect("Slider Control")("Slider")

But then how do I animated them seperately, for exmple, the Slider cotrol is at 100, and I wanna animte layer 1's opacity from 0 to 100, layer 2's opacity from 40 to 100, layer 3's opacity from 50 to 100, layer 4's opacity from 20 to 100, and so on...
How can I do that, so when I change the slider value to like 85, the opacities will animate from the former values (0, 40, 50, 20) to the latter which is 85.

Re: Automatically-Calculated Keyframe

PostPosted: 07/11/2015, 12:51 am
by star+circle
To me it sounds like you need two sliders, one with the value that you want the keyframes to go to (if you are planning on having different values), and another slider that gives the balance between original keyframed values and the target value.

So slider "A" (target value) would be set to, say, 85.

Slider "B" (balance) would be animated from 0 to 100, and you would calculate the actual value from the balance:

((keyframed value) x (100-B) + (target value "A") x B)/100

Along those lines.

Re: Automatically-Calculated Keyframe

PostPosted: 07/16/2015, 12:21 pm
by brurpo
I think this is what you want.

Assuming you have a layer named CONTROL, where you put your slider control

Code: Select all
ease(time, key(1).time, key(2).time, opacity.key(1), thisComp.layer("CONTROL").effect("Slider Control")("Slider"))

You can freely set key frame 1 and 2 position, and set keyframe 1 value, keyframe 2 value is set to slider control.

This is assuming you want an ease interpolation between keyframes, if not, change ease to linear on the code.