Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Creating a script to apply an expression

  • Creating a script to apply an expression

    Posted by Rob Moffett on April 27, 2009 at 1:00 am

    Hey all,

    I have this expression:

    i=index-1;
    p=thisComp.layer(“spline”).position;
    s=thisComp.layer(“spline”).effect(“distribute”)(“Slider”);
    q=thisComp.numLayers-1;
    n=thisComp.layer(“spline”).in_point;
    t=thisComp.layer(“spline”).out_point;
    d=(t-n)/q;
    e=d*i*s;
    z=p.valueAtTime(e);
    [value[0],value[1],z[2]]

    I need to apply it to a LOT of layers. And unfortunately i cant copy and paste the position of one and paste to all, because that copies the x and y positions too.

    So, instead of applying one by one, I would like to make a script that applies this expression to selected layers position property.

    Any advice?
    Thanks so much guys.

    Rob Moffett replied 17 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    April 27, 2009 at 3:32 am

    Apply the expression to one layer, select the Position property, then Edit > Copy Expression Only, select the other layers, Edit > Paste.

    Dan

  • Rob Moffett

    April 27, 2009 at 4:08 am

    Haha, so much more simple than I thought!

    You truly are the expression god.

    Thanks D-man!

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