Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using Follow The Leader expression with multiple shapes within a single shape layer

  • Using Follow The Leader expression with multiple shapes within a single shape layer

    Posted by Jordan Shipman on June 27, 2013 at 4:38 pm

    I’m trying to use the “follow the leader” expression to animate multiple paths/shapes within a single shape layer. I’m not sure how to modify the expression to reference the individual “contents” of the shape layer or if this is even possible.

    Trying to clarify–rather than using multiple layers with the expression I want to use multiple shapes within a single shape layer. The reason being is I have some vector art that I am converting to shapes in after effects and it converts all the shapes within a single shape layer and I want to be able to get the transform properties for each path/shape/content.

    Am I making sense? Thanks for the help!

    delay = 5; //number of frames to delay

    d = delay*thisComp.frameDuration*(index - 1);
    thisComp.layer(1).position.valueAtTime(time - d)

    Dieg Veras replied 9 years, 8 months ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    June 27, 2013 at 6:25 pm

    It’s a little trickier for shapes. It helps to use the mysterious propertyGroup() function to navigate the hierarchy of properties. It should look something like this:

    delay = 5; //number of frames to delay
    leaderProp = thisComp.layer(“Shape Layer 1”).content(“Ellipse 5”).transform.scale;
    leaderIdx = leaderProp.propertyGroup(2).propertyIndex
    myIdx = thisProperty.propertyGroup(2).propertyIndex;
    deltaIdx = Math.abs(myIdx-leaderIdx);
    d = delay*thisComp.frameDuration*deltaIdx;
    leaderProp.valueAtTime(time – d);

    Dan

  • Dieg Veras

    September 4, 2016 at 5:01 pm

    Hello, it works fine but is it possible to specify one fixed axis of the position (in order to not follow the x Leader ‘s position)?
    Thank you

  • Dan Ebberts

    September 4, 2016 at 5:23 pm

    I haven’t tested this, but try changing the last line to this:

    p = leaderProp.valueAtTime(time – d);
    [value[0],p[1]]

    Dan

  • Dieg Veras

    September 4, 2016 at 5:28 pm

    It works great
    Thank you 🙂

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