Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions layer marker triggers upscale-hold x frames-downscale

  • layer marker triggers upscale-hold x frames-downscale

    Posted by Peter Zeet on July 25, 2017 at 2:14 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!!

    Juanluis Vich replied 8 years, 5 months ago 3 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    July 25, 2017 at 3:42 am

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

    Dan

  • Peter Zeet

    July 25, 2017 at 10:10 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——–

  • Dan Ebberts

    July 25, 2017 at 1:19 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

  • Peter Zeet

    July 25, 2017 at 1:32 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?

  • Juanluis Vich

    November 28, 2017 at 2:59 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!

  • Dan Ebberts

    November 28, 2017 at 7:28 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

  • Juanluis Vich

    November 28, 2017 at 3:02 pm

    awesome, thank you!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy