Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Linear wipe through multiple layers

  • Linear wipe through multiple layers

    Posted by Felix Wedgwood on November 15, 2014 at 8:30 pm

    Hi, I am trying to set up a project where by i can drop multiple stills images into a comp and have a linear wipe go through them one by one, all controlled by expressions.
    similar to vfx breakdown’s you get on Youtube

    Being an intrepid novice to expressions I though “I can do that, no problem!”

    So I have a comp with the images in it and another comp with the wipe effect in it. Inside the wipe effect comp I have 2 layers, a null with two sliders and a solid with a linear wipe effect.

    The first slider (called pause) controls the length of time before the wipe effect begins and 2nd (called wipeSpeed) controls speed of the wipe. See screen shot attached

    This works great I can apply a set channels effect to each image layer that takes its alpha channel from the comp with the wipe effect. See screen shot attached

    But this is just the first step after this I have become stumped, searching the web unsuccessfully for information, I hope I can get some advice here.

    What I think needs to happen next is once the transition % for the wipe has reached 100 the time (play head for the comp) needs to go back to frame 0 and the whole process begins again.

    Each time the cycle has run the upper most layer in the stack, that is visible, needs to be made invisible, that way each new layer below can be revealed and the whole layer stack is played through sequentially.

    I hope that makes sense and there is someone out there that can help. Thanks for your time.

    Felix

    if (time < thisComp.layer("Controls Wipe").effect("pause")("Slider")){

    0

    }else{

    ((time - thisComp.layer("Controls Wipe").effect("pause")("Slider")) * thisComp.layer("Controls Wipe").effect("wipeSpeed")("Slider"))

    }

    Felix Wedgwood replied 11 years, 5 months ago 2 Members · 4 Replies
  • 4 Replies
  • David Conklin

    November 18, 2014 at 4:19 pm

    You may be overcomplicating it. If I’m gathering correctly, you just want each layer of a comp to be progressively linear wiped. You can use each layer’s index property as a way to offset these wipes.

    I made a null called “Controls” in my comp and placed 2 sliders on it – one called ‘delay’ which I set to 30(frames) and one called ‘trans_time’ which I also set to 30(frames). I then created a bunch of solids in the comp and placed a linear wipe with this expression on the ‘transition completion’ property on each of them.

    I am also attaching a project file so you can see how this looks. Let me know if this is what you were looking for.

    8201_linearwipes.aep.zip

    Edit: Something interesting here, as well, is that you can make the delay value negative in order to make the transitions overlap.

    var delay = thisComp.layer("Controls").effect("delay")("Slider") * thisComp.frameDuration; //convert to frames
    var trans_time = thisComp.layer("Controls").effect("trans_time")("Slider") * thisComp.frameDuration; //convert to frames
    var idx = index - 2; //to make the first solid 0 (to compensate for null and index starting at 1);

    var beginTime = (trans_time * idx) + (delay * idx); //make start time
    var endTime = beginTime + trans_time; //make end time

    linear(time, beginTime, endTime, 0, 100);

  • Felix Wedgwood

    November 19, 2014 at 12:26 am

    Hi David, thanks so much for taking the time to respond and tinker with the idea, I really appreciate your help. This week is nuts but as soon as I have time (this weekend)I will take a look at your project and shoot back my impressions. Thanks again for the help :-))

  • Felix Wedgwood

    November 27, 2014 at 1:36 am

    Hi David, finally had a moment to sit down with your creation and all I have to say is “so simple, so BRILLIANT!” The linear function was unfamiliar to me so I searched it and came across this free AE Tuts video which others may be interested in-

    Thanks again Sir you have restored my faith in Humanity!!
    I shall post again with my complete render, hopefully in the not too distant future…
    Cheers 😀

  • Felix Wedgwood

    December 7, 2014 at 10:44 pm

    Hi David, it would be awesome to get you advise on this.
    I’ve added a variable called offSet, see modified script below.

    This is because I have a split screen effect where there are two comp’s each using the linear wipe expression you wrote but I didn’t want them wiping in sync, rather for it to look like the wipe is going all the way across the split screen, so the wipe on the right is delayed to create this effect. It does seem to be slowing down the speed of the wipe on the right of screen though, could be my imagination!?
    The only other thing I would love to get your input on is… Is there a way to have the fist image, and the last image, in the sequence stay on screen longer than the images in between?
    Cheers, Felix

    var offSet = thisComp.layer("Controls for Cabinet").effect("offSet")("Slider") * thisComp.frameDuration;
    var delay = thisComp.layer("Controls for Cabinet").effect("delay")("Slider") * thisComp.frameDuration;
    var trans_time = thisComp.layer("Controls for Cabinet").effect("trans_time")("Slider") * thisComp.frameDuration;
    var idx = index - 2; //to make the first solid 0;
    var beginTime = ((trans_time * idx) + (delay * idx)) + offSet;
    var endTime = beginTime + trans_time + offSet;
    linear(time, beginTime, endTime, 0, 100);

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