Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions multiple linear() in one expression.

  • multiple linear() in one expression.

    Posted by Smet Kira on May 3, 2023 at 3:36 pm

    Hi all. Can I use two linear() somehow? for example the first one is linear(time,0,1,10,20) and the second one is linear(time,3,4,20,30) ?

    I thought it was something like this:

    linear(time,0,1,10,20) + linear(time,3,4,20,30)  or   linear(time,0,1,10,20) && linear(time,3,4,20,30)

    and is it possible to somehow use one linear () in a cycle for()?

    Smet Kira replied 3 years ago 3 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    May 3, 2023 at 3:42 pm

    You’d probably set that up like this:

    time < 3 ? linear(time,0,1,10,20) : linear(time,3,4,20,30)
  • Smet Kira

    May 4, 2023 at 5:35 am

    Damn, how did I not guess) Thanks Dan.

    Is there a way to use linear() in a loop? For example something like linear(time,0*i,1*i,0,100)

  • Dan Ebberts

    May 4, 2023 at 6:01 am

    Sure, but it depends on what you’re trying to do. I’m having a hard time thinking of a scenario where that would be useful.

  • Smet Kira

    May 4, 2023 at 6:11 am

    I want to make an animation loop, something like LoopOut, but only loop the animation through the expression for() and linear().

    For example, the ball moves from left to right, and then starts it again and does exactly as many iterations as I specify in For().

    I hope I was able to explain

  • Dan Ebberts

    May 4, 2023 at 6:36 am

    You could certainly do it, but you’d probably have to collect all the linear() results into some sort of accumulator variable (I’m guessing–I’m still not picturing how you would actually use it).

  • Filip Vandueren

    May 4, 2023 at 8:20 am

    Perhaps it’s handier to do something to your time variable.

    for example:

    t=time%10;
    t<5 ? linear(t,0,5,100,200) : linear (t,5,10,200,100);

    because t is now looping, you don’t need more linear()s

  • Smet Kira

    May 4, 2023 at 8:44 am

    Thx you all!

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