Skip to main content
Inspiring
March 24, 2010
Question

Emulating a UI time scale

  • March 24, 2010
  • 1 reply
  • 810 views

I'm trying to replicate this effect for a UI mockup  (click images to animate)

Here's what I have so far...

Each layer has a multiplier value slider. The further away from center, the higher the multiplier (I manually enter each value). I have a null controlling the offset with a slider.  And each layer has this applied to the position:

layerpos = transform.position;

S = thisComp.layer("Null 1").effect("offset")("Slider");

m = effect("multiplier")("Slider")

layerpos + [S*m[0],value[1]]

It works, but I wasn't sure if there was an easier way. Like somehow automating the multiplier value to the layer index #.

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
March 24, 2010

Assuming that the sliding layers are at the top of the layer stack and start out positioned at the center of the range, I'd try something like this:

S = thisComp.layer("Null 1").effect("offset")("Slider");
m = Math.floor(index/2) * ((index%2) ? -1 : 1);
value + [S*m,0]

Dan

Inspiring
March 25, 2010

Thanks Dan!!