Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions a slider to trim them all

  • a slider to trim them all

    Posted by Peter Zeet on January 12, 2012 at 10:39 pm

    hi!
    I have a lot of shape layers, and want to make their strokes grow sequentially, so using trimming paths, when I have one path grown, I want next shape layer to grow, and so on.. I could keyframe them all, but as I have a lot of shape layers, controlling and refining all the generated keys can be a pain..
    So, my question….
    is it possible to make a null, add a slider (or 2, one called “end” and another called “)start”, and make that slider control all that as a whole? so, as I increase the slider`s value, first shape layer grows, and when it ends to grow shape layer 2 starts growing, and so on
    basically: make it act as if all shapes where inside a same shape layer`s group and then adding trim paths to trim them sequentially…

    many thanks in advance!

    Peter Zeet replied 14 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 12, 2012 at 11:52 pm

    Assuming your slider is on “Null 1” and your first 10 layers are participating shape layers, something like this should work:

    firstShapeLayer = 1;
    lastShapeLayer = 10;
    sliderRange = 100;
    s = thisComp.layer(“Null 1”).effect(“Slider Control”)(“Slider”);

    numSegs = lastShapeLayer-firstShapeLayer+1;
    segRange = sliderRange/numSegs;
    myIdx = index-firstShapeLayer;
    myStart = myIdx*segRange;
    myEnd = (myIdx+1)*segRange;
    linear(s,myStart,myEnd,0,100)

    Dan

  • Peter Zeet

    January 13, 2012 at 12:01 am

    I love you!
    works like a charm 🙂

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