Activity › Forums › Adobe After Effects Expressions › Control Layer position by slider scale
-
Caleb Power
October 29, 2013 at 11:14 pmSorry, I don’t think I’m explaining it very well.
So I have 7 layers. Each is titled whatever number it is. One layer is named “1,” one is “2,” and so on all the way to “7.”
They are positioned exactly like this:
1 2 3 4 5 6 7
There is a dot that is right above the numbers that slides left and right to stop over a number to bring attention to that number.
All numbers at default are at 100% scale and 40% opacity. Whatever number the dot is above, that number is at 120% scale and the opacity is at 100%.
So, the layer named “dot” is the one that each layer responds to. (Each layer has the right expression for that to happen, you helped me with that, thanks!)
So instead of dragging the x position of the layer named “dot” for example from the layer named “1” to the layer named “4,” and copying and pasting key frames, I’d like to just be able to use a slider control (or whatever it is that will enable me to do this) to type “1” to go to the same x value of whatever layer “1” has as it’s x value. And then type “4” to make that layer named “dot” to slide over the layer named “4.”
So whether it’s a slider control or whatever, it will know that “1” is the same x value as the layer named “1.” Same for all other numbers.
-
Dan Ebberts
October 29, 2013 at 11:22 pmIt’s a little complicated, but certainly do-able. This would be a position expression for the dot. It would need to find the most recent, previous keyframe, convert that to text, and use that as the layer name to get the “from” x value. Then it needs to do the same with the next keyframe to get the “to” x value. Then you would use the times of those two keyframes to drive an ease() between the two x’s. They tricky part is taking care of what happens before you get to the first keyframe and after you pass the last one. Maybe someone will have time to help you set it up.
Dan
-
Caleb Power
October 29, 2013 at 11:42 pmOk. It isn’t necessary to do what I’m wanting to do, just a little more efficient. Thank you Dan!
-
Eduardo Asta
May 10, 2022 at 8:23 pmThanks Dan…but if I was trying to control the scale property, could I write it like that?
slider = effect(“Slider Control”)(“Slider”);
size = linear(slider,0,100,50,200);
[size[0],size[1]]
Reply to this Discussion! Login or Sign Up