Copy link to clipboard
Copied
I've searched for an expression that will use a slider to change the x position on the last keyframe but can only seem to get it work on adjusting the first keyframes x position instead.
Any help as to what I need to amend in the expression to get it work would be great.
firstValue = key(1).value[0];
sliderValue = effect("Slider Control")(1);
x = linear(time, key(1).time, key(numKeys).time, firstValue, sliderValue);
// x = ease(time, key(1).time, key(numKeys).time, firstValue, sliderValue);
// x = easeIn(time, key(1).time, key(numKeys).time, firstValue, sliderValue);
// x = easeOut(time, key(1).time, key(numKeys).time, firstValue, sliderValue);
[x, value[1]]
In your screenshot you're not using a linear interpolation so you may need to use an ease() instead of
...Copy link to clipboard
Copied
Your code makes no sense. The driver in a linear() function is time or another slider's input, not the property base value itself. Simply fix the function and it will work.
Mylenium
Copy link to clipboard
Copied
Hi Mylenium,
If you could help me with what is correct that would be great.
Thanks
Copy link to clipboard
Copied
firstValue = key(1).value[0];
sliderValue = effect("Slider Control")(1);
x = linear(time, key(1).time, key(numKeys).time, firstValue, sliderValue);
// x = ease(time, key(1).time, key(numKeys).time, firstValue, sliderValue);
// x = easeIn(time, key(1).time, key(numKeys).time, firstValue, sliderValue);
// x = easeOut(time, key(1).time, key(numKeys).time, firstValue, sliderValue);
[x, value[1]]
In your screenshot you're not using a linear interpolation so you may need to use an ease() instead of linear()
Copy link to clipboard
Copied
That's amazing, thanks for that. Very helpful. How would I adjust the easing to say a specific in and out velocity. Or is that not possible?