Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions time remapping with expression (?)

  • time remapping with expression (?)

    Posted by Ido Shor on September 7, 2016 at 7:06 am

    Been trying to link the position of an Emitter (light) to a slider value, which changes every 25F. (getting it’s value from a random expression)
    I need to use the Linear expression so the value I get from the slider will translate to legit position value for the emitter. (that is a given fact…) what I got was a jumpy animation of the Emitter instead of a nice ease movement between each value change.

    obviously it did that…. but I tried to take it from here and write something that will give it the interpolation I need in-between. thought maybe to use a time-remapping expression, but I am not sure that would be the solution.

    any thoughts?

    Tnx, Ido.

    Ido Shor replied 9 years, 10 months ago 3 Members · 11 Replies
  • 11 Replies
  • Kalleheikki Kannisto

    September 7, 2016 at 8:13 am

    Use the ease() expression instead of linear() and you will get a smoother result. You can set it up to ease at each end of the range.

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Ido Shor

    September 7, 2016 at 10:47 am

    yes, I actually didn’t write my post properly…. I DID used the “Ease function” in my equation.
    but it didn’t change or solve my issue.

    thanks anyhow Kalle.

  • Kalleheikki Kannisto

    September 7, 2016 at 12:55 pm

    Do you mean you have an expression that changes the value suddenly every 25 frames (like a hold keyframe) but you need the emitter to move smoothly between the positions?

    Kalleheikki Kannisto
    Senior Graphic Designer

  • Ido Shor

    September 7, 2016 at 2:15 pm

    yes, that is the case.
    exactly.

  • Dan Ebberts

    September 7, 2016 at 4:39 pm

    Hard to say exactly, but probably something like this (not tested):

    slider = ??; //(link to your slider here)
    period = 25; // frames
    tPeriod = framesToTime(25);
    seg = Math.floor(time/tPeriod);
    t = time%tPeriod;
    v1 = slider.valueAtTime(seg*tPeriod);
    v2 = slider.valueAtTime((seg+1)*tPeriod);
    ease(t,0,tPeriod,v1,v2)

    Dan

  • Ido Shor

    September 10, 2016 at 10:37 am

    Thanks Dan,

    wiIll test that and come up with the results!

    I can think of a few ways this script could come in handy…

    cheers,
    Ido

  • Ido Shor

    September 10, 2016 at 8:32 pm

    Ok, Here are my foundlings

    a graphical view of the behaviour of this expression:

    the white line is the random value of the slider (with a posterizeTime expression added to change the value only every nth frame).
    the green line represent the interpolation expression on the position.Y axis of the layer.

    correct me if I am wrong, but it seems that the expression is generating the interpolation between two keyframes over a period of 25f, and not every 25f.

    since the change is happening only every 25f, it needs to calculate it only between the 25th frame and the 26th frame and so on.

    how can we achieve that?

    cheers, Ido.

  • Dan Ebberts

    September 10, 2016 at 8:45 pm

    You lost me. Can you draw what you want the result to look like?

    Dan

  • Ido Shor

    September 11, 2016 at 7:09 am

    🙂

    sure Dan,
    what I am aiming at here is building a graph that will step forward every 25f, getting it’s values (the Y value that is), from a slider which has a random expression to it:

    x = 25;
    f = thisComp.frameDuration * x;
    posterizeTime(1);
    Math.round(random(300,600))

    the object which generates the graph is an Emitter of Particles moving according to this expression.

    so, I need this expression to get the values generated from the random slider, and add an ease interpolation, between each value change over a period of 25f. but at the same time, it has to keep still for 25f before moving on to the next keyframe…. (remember the steps?…)

    that’s basically it.

    cheers,
    Ido.

  • Kalleheikki Kannisto

    September 11, 2016 at 7:39 am

    I think you’d get that if you change the posterize time value to 2, at which it would interpolate for 25 frames and hold the value for another 25 frames for a total of 50 frames per step.

    Kalleheikki Kannisto
    Senior Graphic Designer

Page 1 of 2

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