ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# layer marker triggers upscale-hold x frames-downscale

FAQ   •   VIEW ALL
 layer marker triggers upscale-hold x frames-downscale on Jul 25, 2017 at 2:14:23 am

Hiya!
this questions should be super ease to achieve, but it seems I'm totally lost and not getting anything to work.
I want a ball to grow each time a layer marker is reached. (that would be the trigger) Then I just want the ball to go from scale [100,100] to [80,80] (with no linear or ease, just jump to that value), hold at [80,80] for some frames decided on a var called holdTime, and then go back to the [100,100]

I've tried different options but seems to always fail, any ideas?

thanks!!

 Re: layer marker triggers upscale-hold x frames-downscaleon Jul 25, 2017 at 3:42:08 am

It's not clear to me exactly what is supposed to happen at the markers.

Dan

 Re: layer marker triggers upscale-hold x frames-downscaleon Jul 25, 2017 at 10:10:16 am

ah
there is a ball, with a scale of [100,100], and when there is a marker, it goes from [100,100] to [80,80], stays at [80,80] during some frames, and then it goes back to [100,100]
giving a holding time of, per example .5 sec
so it would be:
100% scale -----------*marker* 80%scale ---- holding time--- 80%scale----100% scale -------------*marker*etcetc--------

 Re: layer marker triggers upscale-hold x frames-downscaleon Jul 25, 2017 at 1:19:02 pm

I think that would be like this:

``` holdTime = .5; n = 0; if (marker.numKeys > 0){ n = marker.nearestKey(time).index; if (marker.key(n).time > time) n--; } if (n == 0){ s = 100; }else{ t = time - marker.key(n).time; s = (t < holdTime) ? 80 : 100; } [s,s] ```

Dan

 Re: layer marker triggers upscale-hold x frames-downscaleon Jul 25, 2017 at 1:32:46 pm

fantastic!! I was coming with a super ugly and dirty solution, but this one is neat and simple! thaks!

I have a related question, but don't know if it can make the previews take much longer as for the precalculations (and speaking about a lot of layers)

so: if I add a checkbox so if it is clicked it gets rid of the markers actions and let me use muy own keyframes and vice-versa? so if its not clicked it would use the code before, but getting totally rid of any manual keyframing?

 Re: layer marker triggers upscale-hold x frames-downscaleon Nov 28, 2017 at 2:59:54 am

HI!
how it could be modified so we have a linear animation with fade time?
so it is like: once the marker is reached go from 80 to 100 in .2, then hold .5, then go back to 80 in .2

thanks!

 Re: layer marker triggers upscale-hold x frames-downscaleon Nov 28, 2017 at 7:28:24 am

Something like this probably:

``` holdTime = .5; fadeTime = .2; n = 0; if (marker.numKeys > 0){ n = marker.nearestKey(time).index; if (marker.key(n).time > time) n--; } if (n == 0){ s = 80; }else{ t = time - marker.key(n).time; if (t < fadeTime + holdTime){ s = linear(t,0,fadeTime,80,100); }else{ s = linear(t,fadeTime+holdTime,fadeTime*2+holdTime,100,80); } } [s,s] ```

Dan