Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions trails with position variables

  • trails with position variables

    Posted by Christine Edwards on March 14, 2011 at 4:38 pm

    I have a white ellipse that enters screen left and exits screen right (basic animation here:https://www.youtube.com/watch?v=jUIgcULk9n8)

    I’ve plugged this script into the position expression:
    strt = 0; //start time of template motion
    end = 4.0; //end time of template motion

    t = thisComp.layer(“template”);
    offset = (t.effect(“offset”)(“Slider”)/100)*(index -1);
    travel = linear(t.effect(“travel”)(“Slider”)/100,strt,end);
    t.position.valueAtTime(travel – offset)

    I got this script from:https://www.motionscript.com/mastering-expressions/follow-the-leader.html
    under “Follow the Null”

    this script is working well, but I want to add follow the nulls z rotation and also make a “spread” slider so that I can spread my white ellipses so that they aren’t all in one train line.

    sorry if this is a FAQ but I can’t find my exact situation and I’m not good with expressions to design or modify!

    strt = 0; //start time of template motion
    end = 4.0; //end time of template motion

    t = thisComp.layer("template");
    offset = (t.effect("offset")("Slider")/100)*(index -1);
    travel = linear(t.effect("travel")("Slider")/100,strt,end);
    t.position.valueAtTime(travel - offset)

    Dan Ebberts
    replied 15 years, 1 month ago
    2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    March 14, 2011 at 7:55 pm

    You can adapt the expression to z rotation like this:


    strt = 0; //start time of template motion
    end = 4.0; //end time of template motion

    t = thisComp.layer("template");
    offset = (t.effect("offset")("Slider")/100)*(index -1);
    travel = linear(t.effect("travel")("Slider")/100,strt,end);
    t.transform.zRotation.valueAtTime(travel - offset)

    I’m not sure what you mean by “spread”. Can you be more specific?

    Dan

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