Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animate property based off XPos + Time?

  • Animate property based off XPos + Time?

    Posted by Matt Chandronait on June 3, 2010 at 1:26 am

    So it’s pretty straightforward to animate, say, opacity based off time, but let’s say I want to animate it based off time AND off where the layer is on the screen. Essentially I want layers with lower X positions to reveal themselves before layers with higher X positions so the layers are gradually filling up the screen from left to right. I’m working with a comp that has hundreds of layers all forming up a pattern, so hand animating this would be a nightmare and I can’t find QUITE enough help for my newbishness to make this happen.

    Matt Chandronait replied 15 years, 11 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    June 3, 2010 at 3:16 pm

    Something like this should do it:

    wipeDur = 3;
    fadeDur = .5;

    fadeStart = wipeDur*(transform.position[0]/thisComp.width);
    linear(time,fadeStart,fadeStart+fadeDur,0,100)

    Dan

  • Matt Chandronait

    June 3, 2010 at 7:15 pm

    Wow! Perfect. Works like a charm. Thanks a ton Dan :). Now to go and research everything you’ve done there so that I can learn from it. I can see the principles being very valuable in the future. Thanks again!

  • Matt Chandronait

    June 4, 2010 at 12:41 am

    So the above did indeed work exactly as intended, but now I’m thinking it would be better to minorly stagger the elements. It seems like I’d want to wiggle fadeStart, but I’m still a little iffy on how wiggle actually works. I’ve read the AE help on the arguments it needs, but the only value I seem to really get for the opacity is either 0 or 100. Can I bother you for some more help? 🙂

  • Dan Ebberts

    June 4, 2010 at 2:31 am

    There are probably a lot of ways to do it. Try this one:

    wipeDur = 3;
    fadeDur = .5;
    randomRange = .5;
    seedRandom(index,true)

    fadeStart = wipeDur*(transform.position[0]/thisComp.width) + random(randomRange);
    linear(time,fadeStart,fadeStart+fadeDur,0,100)

    Dan

  • Matt Chandronait

    June 4, 2010 at 6:01 pm

    Oh man that is SO much simpler than what I was trying to do :). It’s pretty elegant when you understand what’s going on. After looking up the elements of what you’ve done above, I think I’ve learned an awful lot. I even hooked up randomRange to a slider so that I could test multiple values efficiently. It’s a small thing, but for someone who’s an AE scripting novice it made me happy.

    Thanks again, Dan!

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