-
Control 2 Keyframes values with a slider
Hi.
I usually use this expression to control the second keyframe with a slider (works well when i just have 2 keyframes), but what if i have 4 keyframes, and i want to control the second and the third keyframes with the same slider? It’s possible to adapt this expression? The first and fourth keyframe should keep their defined position.
prop = thisProperty
firstKey = prop.key(1).time;
lastKey = prop.key(2).time;
distanceTotal = prop.valueAtTime(lastKey) - prop.valueAtTime(firstKey);
distanceCurrent = prop.valueAtTime(lastKey) - prop.valueAtTime(time);
percentage = 1 - distanceCurrent/distanceTotal;
offset = effect("SLIDER")("Slider")
value + offset*percentage;
Sorry, there were no replies found.