ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Scale 4 different sized circles with slider with delay

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David Gabriel
Scale 4 different sized circles with slider with delay
on May 8, 2019 at 6:20:36 am

Hi there,

I have four coloured circles on top of each other. Each upper layer circle is slightly smaller than the one below (so all circles can be seen). Picture is attached.

I am scaling the circles and have used a slider to control this.

I want each outer circle to multiply their scale so they get slightly larger than the inner circles and not maintain the same uniform scale.
So far I have added '*1.2 + 25' to each expression.

Here is where I am struggling:
I want to have a delay on the scale of the inner circles so that they delay scaling 3 frames after the outer circles.

I also have the problem with my expression that when the slider is at zero not all of the circles are scaled at zero because I always have the +25 or +50 or + 75 in the expression.

So I think I need to do it from scratch but I need help. Any help will be greatly appreciated.

Thanks.

David.





temp = thisComp.layer("Scale Slider").effect("Slider Control")("Slider")*1.2+75;
[temp, temp]


Return to posts index

Andrei Popa
Re: Scale 4 different sized circles with slider with delay
on May 8, 2019 at 12:40:43 pm

For the delay you should use valueAtTime function:

delay = 0.1;
slid=thisComp.layer("Scale Slider").effect("Slider Control")("Slider").valueAtTime(time-delay);
temp = slid*1.2+75;
[temp, temp]


As for all of them getting to zero, i think you should go minus with the slider and modify the opacity or just cut the layers that go beyond 0.

Andrei
My Envato portfolio.


Return to posts index

David Gabriel
Re: Scale 4 different sized circles with slider with delay
on May 8, 2019 at 11:12:18 pm

Nice one, that worked perfectly. Thanks Andrei.

I was thinking as well, is there a way to make only one of the circles (the largest one in the background) to be controlled by the slider, and then make the other three circles as children of each other sequentially and add a delay on their scale?

You've already solved my problem, this is just more out of curiosity for now.

Thanks.

David.


Return to posts index


Andrei Popa
Re: Scale 4 different sized circles with slider with delay
on May 9, 2019 at 12:50:19 pm

You could make it that way too, but it is slower. And it grows in complexity very fast if you have multiple layers. That is because expressions don't have memory. So the last circle will send you to the 3rd, calculate its expression which then sends you to the 2nd, calculate that etc.

With all of them linked to a single slider, each expression calculates only once. So i guess the best way is to calculate the difference and repeatedly apply it to your layers.

For example, instead of "25, 50, 75" write "25 * index" if your layers start at one. Or substract the necesarry amount if they don't start at one (ex: "25*(index -x)"

Andrei
My Envato portfolio.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]