Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Continue interpolation of linear expression beyond its paramaters

  • Continue interpolation of linear expression beyond its paramaters

    Posted by Harry Hoag on December 8, 2015 at 3:44 pm

    Hiya,

    I’m using the linear interpolation expression. At the moment the interpolation is clamped when you get to the entered value range, I was wondering if there was a way to make the calculation continue beyond the values?

    If anyone uses cinema 4d, the range mapper node in xpresso does this. You simply put in your lower and upper values and then just leave it un-clamped and the calculation will continue beyond your values.

    I hope this makes sense, I’ve included my current expression below.

    thanks

    input = thisComp.layer("shadow_position").transform.position[0];

    inputLow = -238;

    inputHigh = 2047;

    outputLow = -56;

    outputHigh = 63;

    linear(input,inputLow,inputHigh,outputLow,outputHigh)

    Michael Szalapski replied 9 years, 3 months ago 3 Members · 2 Replies
  • 2 Replies
  • Xavier Gomez

    December 9, 2015 at 7:24 am

    To avoid clamping, you can use this:

    outputLow + (input-inputLow) * (outputHigh-outputLow)/(inputHigh-inputLow);

    Xavier

  • Michael Szalapski

    January 26, 2017 at 9:21 pm

    Thanks! This was really useful.

    – The Great Szalam
    (The \’Great\’ stands for \’Not So Great, in fact, Extremely Humble\’)

    No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.

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