-
How to link a keyframe to a slider control
Hey all,
I want to do something fairly simple:
Got 2 keyframes on the opacity of a layer
The first keyframe has a value of 0
The second keyframe has a value of 0Now I want to be able to control the second keyframe with a slider control. So when the slider value is 50, the keyframe value is 50 (so the animation will be from 0 to 50). is there a keyframe index that I can use to link it up with a slider control? and in a way where I can simply change the slider and everything will update without issues?
I’ve found expression that does the trick, but they seem way too complex for my situation and I have no idea what’s going on here:
keyNumToChange = 3; //change this - the key num to change (numbering starts at 1)
newVal = [1500, 460]; //change this - the new position.
//-------
nearKey = thisLayer.position.nearestKey(time).index;
lastKey = (thisLayer.position.key(nearKey).time>time) ? ((nearKey>1) ? nearKey-1 : nearKey) : nearKey;
nextKey = (lastKeyI would love to understand how this expression works, but primairly I'd like to know to write something a little more simplified (if possible) and how it exactly works.
Thanks in advance
Regards,
Ramon Peppelenbos