Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions What does this expression do?

  • What does this expression do?

  • Eric Chard

    September 14, 2021 at 11:34 pm

    This expression, from YT “Create Particles Along A Path”, makes a CC Particle world emitter follow the keyframes of a Null Layer:

    target = thisComp.layer(“Null”);
    (target.positions[0]-(thisComp.width/2))/thisComp.width

    What’s all that jazz in the 2nd line about? I can’t parse it: does it have something to do with CC Particle emitters being registered at the center of the comp instead of the upper left? (I think I’m close, but I don’t get it….)

    Thnx for any enlightenment.

  • Dan Ebberts

    September 15, 2021 at 12:23 am

    That’s because the Particle World Producer property expects its X coordinate (in this example) to be a percentage of comp width relative to the comp center. So the the second line of the expression calculates how far the null’s x position is from the x position of the comp center and divides that by the comp width to get a normalized value between -.5 and +.5.

  • Eric Chard

    September 15, 2021 at 6:53 pm

    Ahhh! PERCENTAGE of comp width! ::the light dawns::

    Thank you, Mister Ebberts!

Viewing 1 - 3 of 3 posts

Log in to reply.

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