Animated Lists

So I was working on a list effect in AE. I had a list of 30 items to show, and the middle one had to be highlighted. Naturally, as they passed by, they had to highlight as well.
I chose the highlight effects as stronger opacity and higher scale. But, there was no way I was going to animate 30 items individually.







I played around with expressions for a while, then realized I could use linear() and length() to produce this effect.
The idea was to use the length() to measure the distance from the text and the centre of the comp. Then use linear() on the Scale, and reference the linear() to the length().
I explain how to use linear in the ebook.


distance=length(position, [thisComp.width/2, thisComp.height/2);
linear(distance, 0, 70, [100,100], [50,50]);


So, linear is referring to the distance between the text layer (this layer) and the doing some interpolation. If the length (in this case distance) is 0, the scale will be 100%. If the distance is 70 or greater, it will be 50%!
Linear will then interpolate between 0 and 70 for 100 and 50. So if the length is 20, the scale will be around 80.

I also found that linear tends to be a little harsh, so I change it to ease.

If you know me, you know I love editability without breaking into the code again. In the case of the job, I did it with code coz I knew exact values. But once the work was delivered I thought I'd save this as a preset for future use... you never know...

So first thing I did was add two nulls. One that the texts would be parented to, and the second being the one being the reference where the texts would scale up. Then a bunch of Slider Controls in the reference.


myPos=position+thisLayer.parent.position;
dist=length(thisComp.layer("REFERENCE").position,myPos);
minA=thisComp.layer("REFERENCE").effect("Min")("Slider");
maxA=thisComp.layer("REFERENCE").effect("Max")("Slider");
min=[minA,minA];
max=[maxA,maxA];
radius=thisComp.layer("REFERENCE").effect("Radius")("Slider");
ease(dist,0,radius,max,min);


It's important to remember that "max" is actually tied to 0.

Finally, I added some code to the Position so I could tweak their separation. Better safe if I need to tweak it.



separateValue=thisComp.layer("REFERENCE").effect("Separation")("Slider")*(index-1);
separate=[0,separateValue];
[0,0]+separate;




Awesome!
I'll be working on different modes (such as if the list could be around a circle and rotate), then get to work on the PresetEffects.xml for custom controls for it. Then we'll see it on Ideas to Creations.

Thanks!

Comments

Popular Posts