Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions speed driven opacity

  • speed driven opacity

    Posted by Josh Holdens on October 1, 2014 at 1:37 pm

    I have been working on an expression that drives the opacity of the layer based off the layers speed. The idea is to have the obj opacity reach 100 when it comes to a rest, stay at 100 and when it is animated again the opacity is driven to 0. So far the expression that I have come up with only works partially. The effect starts off at 0 opacity and as speed reaches 0 opacity goes to 100, however when I animate to its next position the obj re – fades back to 100. At this point I want it to go to 0.Here’s what I have so far:

    x = transform.position.speed;
    If (x>1500){
    0
    }else{
    linear(x,0,1499,100,0)
    }

    Dan Ebberts replied 11 years, 7 months ago 2 Members · 6 Replies
  • 6 Replies
  • Josh Holdens

    October 2, 2014 at 10:32 pm

    I still haven’t had much luck figuring this out. The closest thing that I can describe as to what I’m trying to achieve is a “shooting star” type of effect. I have a few layers that I’m attempting to control and having this work would be great. Otherwise I have hit a brick wall. Is this possible or is there some reference out there that I’ve overlooked….


    x = transform.position.speed;
    If (x>1500){
    0
    }else{
    linear(x,0,1499,100,0)
    }

  • Dan Ebberts

    October 2, 2014 at 11:13 pm

    Maybe it would help if you describe more what you’re trying to do, rather than how you’re trying to do it.

    Dan

  • Josh Holdens

    October 3, 2014 at 1:13 am

    Many thanks for the response. OK here it goes… I am trying to animate my layers from one point to another at the same time calculate the layers speed so that when my layer reaches a certain point the opacity is affected. So the set-up would be layer leaves point A-opacity is zero until A reaches a certain speed. Once that speed is reached the opacity goes up to 100 as layer A stops. Then layer A moves to next point and opacity moves to zero after a certain speed is reached. Thanks for all your help with this!

  • Dan Ebberts

    October 3, 2014 at 1:37 am

    Sorry–I still can’t picture it exactly, but I’m guessing it’s tricky because the expression’s current behavior depends on events that may or may not have happened in the past. So I think you’re probably stuck with a loop that starts at the current frame and goes back far enough in time to figure out what the current calculation mode should be (unless you can think of a different way of framing the problem).

    Maybe somebody else will jump in with some ideas.

    Dan

  • Josh Holdens

    October 3, 2014 at 11:48 am

    Well I have given it some thought, and hopefully this will put what I’m trying to do in the right perspective. Otherwise as many have said, “If YOU say that it’s tricky then….” So… Let’s say that I have Layer A moving and its speed is from 0 – 500. What I want initially is that when Layer A’s speed reaches 175, Layer A’s opacity begins changing from 0 – 100%. Now that Layer A has come to a stop I want to animate it again. Layer A is moving and its speed is 0 – 500 but this time when Layer A reaches a speed of 175 I want Layer A’s opacity to go from the now 100 – 0%. I hope this makes sense, if not “Yikes”. Key-framing it is. Thanks for your help and patience.

  • Dan Ebberts

    October 3, 2014 at 4:53 pm

    Threshold detectors can tricky and this one seems especially tricky because not only does your expression need to figure out how long is has been since the speed crossed the 175 point, but also whether it was accelerating or decelerating when that occurred, not to mention initial conditions (i.e. what happens before the first transition?). Not impossible, but not simple.

    Dan

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