Roei Tzoref wrote:
this seems like something a script could do rather than an expression. have you looked into this? Trigger - aescripts + aeplugins - aescripts.com
This is close to what I'm looking for but not quite. I want to do specific keyframes and that plugin only allows me to do a whole composition or a whole layer, basically just time remapping which is easy to do manually anyways. I'm looking for something where I can move multiple keyframes in multiple compositions to a certain point where they all should end, if that makes any sense.
You could use an expression for each property you wanted to control with a slider. The expression would be based on value at time and you would simply add the time value of the slider to the value of the property.
For example let's say that you added Effects>Expression Controls>Slider Control to a layer with animated position values. You would then add an expression to position and then add = effect("Time Slider")("Slider"); to the first line. Now the variable s defines the value of the slider. Now you need to call out time but you want to add or subtract the slider from time so you would add t = time + s; to the expression as a second line. The last thing you would do would be to use the valueAtTime method from the Expression Language Menu >Property list to the expression. That's all there is to it.
Your final expression would look like this:
s = effect("Time Slider")("Slider");
t = time + s;
This takes the current value of the position and offsets by the number of seconds you dial into the slider. Simple as that. You don't need to build an array because all your are doing is modifying the value at time.
You can use this on any property that you are animating with keyframes. If you have also added an expression to the property that you want to slide around in time then you need to define a variable for the array you are driving (if you are driving an array) and then put this part of the expression at the end. There are times with this will not work with other expressions.
There is nothing keeping you from using one slider to drive every animated property on a layer, you'll just have to add the same expression to each property.
If you wanted to use the slider to count in frames of delay rather than seconds then you would add in a time/thisComp.frameDuration to the mix and a little more math. I'll let you figure that one out on your own.
another take on what Rick has suggested is to use a marker to trigger the valueAtTime.
1. set a marker on the layer - this will be your starting point for triggering the animation
2. apply this expression for the property of the layer:
L = thisLayer;
now your animation will start at the marker