Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions repelling force

  • Posted by Jim Wilcox on May 13, 2010 at 11:59 pm

    Trying to create a expression to repel layers in x,y based on the location of a null. As the null gets closer to a given layer, the layer will deflect to a maximum x,y that can be preset, and use an ease function to make the transition smooth. Not finding anything searching.

    Dan Ebberts replied 16 years ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    May 14, 2010 at 5:40 am

    This can get very complicated, depending on how you expect it to work. Since an expression only has access to the pre-expression value of the property it’s applied to, the expression will not have access to the displacement value calculated on the previous frame. So it would probably end up working like this: as the null approaches the layer, the layer moves away from the null on the line drawn from the null to the layer’s original position. As soon as the null crosses the layer’s original position, the layer will snap to the maximum deflection in the opposite direction. Probably not what you have in mind. If the null never crosses the layer’s original position, then it’s not a problem. If it does, however, the only solution is to build an expression that recreates everything that’s happened from the first frame up to the current time. Not simple, but do-able.

    Dan

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