Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Self – Resize a Bezier Path Shape Layer to Comp size and more

  • Andrei Popa

    September 30, 2020 at 12:19 pm

    It’s not clear to me. How exactly do you want the behavior to be?

    Say the checkbox is checked, so the loading is enabled. How exactly should this template behave. The line starts appearing? How much time does the animation of the appearing last? When does the unloading start? From what end does the unloading start?

    The way you explain it, if the checkbox is selected, the line is there at second 0 and it starts to unbuild until the end of the composition.

    If the checkbox is not checked, the line just starts building itself from start to end.

    Is this the behavior you want?

  • Nick Mara

    September 30, 2020 at 12:26 pm

    Yes, that’s exactly the behavior I want.

    Checkbox OFF = Path building

    Checkbox ON = Path unbilding

    Does that makes sense?

    Thanks

  • Nick Mara

    September 30, 2020 at 1:13 pm

    Oh I forgot to say that I would also like to be able to choose from which point the path starts to unbild itself.

    So now the controller are:

    1 – A slider control which drives the starting point of the path

    2 – A slider control which drives the ending point

    3 – A checkbox control which reverse the direction of the path

    NEW ONE:

    4 – A new checkbox which enables or disables the Path ability to build or unbild.

    5 – A slider control which drives the point from which the path starts to unbild itself.

    I hope this is not too confusing !

    If this is not clear please tell me.

    Thanks

  • Nick Mara

    October 1, 2020 at 9:38 am

    Hey Andrei,

    do you think is there any chance to do this last step?

    I think that it would be really interesting to have all those abilities on just one path.

    Let me know what you think, I would be really happy to know your opinion Grinning

  • Andrei Popa

    October 1, 2020 at 10:11 am

    It’s certainly doable but now I am really busy with another project and this setup wil take a bit of time to finish.

    I am sorry but bills come first ?

  • Nick Mara

    October 1, 2020 at 10:40 am

    Just the fact that you said that this is certainly doable it’s already something for me.

    I hope you will find a bit of time to dive into this project again and finish this set up.

    I’m really curious to know what will be your unusual and smart solution.

    I have total respect for you and I know bills come first so thanks a lot for your precious time.

    So, we’ll talk soon Star Struck

  • Andrei Popa

    October 3, 2020 at 6:54 am

    The path remains the same. Then add these to the start/end of the trim paths

    START:

    function arrIncludes(arr, element) {

    for (var i = 0; i < arr.length; i++) {

    if (element == arr[i]) return true;

    }

    return false;

    }

    L = thisComp.width;

    l = thisComp.height;

    percentL = (50 * L) / (L + l);

    percentl = (50 * l) / (L + l);

    beginPoint = thisComp.layer("Null 1").effect("Start_Point")("Slider").value % 4;

    stopPoint = thisComp.layer("Null 1").effect("End_Point")("Slider") % 4;

    shortPoints = thisComp.layer("Null 1").effect("Reverse_Direction")("Checkbox") == 1 ? [1, 3] : [0, 2];

    firstLInstances = Math.ceil(stopPoint / 2);

    if (arrIncludes(shortPoints, beginPoint)) {

    theEnd = percentl * firstLInstances + percentL * (stopPoint - firstLInstances);

    } else {

    theEnd = percentL * firstLInstances + percentl * (stopPoint - firstLInstances);

    }

    theEnd = theEnd == 0 ? 100 : theEnd;

    if (thisComp.layer("Null 1").effect("Enable/Disable Loading")("Checkbox") == 0) {

    val = linear(time, 0, thisComp.duration - thisComp.frameDuration, 0, theEnd);

    } else {

    val = 0;

    }

    val;

    END:

    function arrIncludes(arr, element) {

    for (var i = 0; i < arr.length; i++) {

    if (element == arr[i]) return true;

    }

    return false;

    }

    L = thisComp.width;

    l = thisComp.height;

    percentL = (50 * L) / (L + l);

    percentl = (50 * l) / (L + l);

    beginPoint = thisComp.layer("Null 1").effect("Start_Point")("Slider").value % 4;

    stopPoint = thisComp.layer("Null 1").effect("End_Point")("Slider") % 4;

    shortPoints = thisComp.layer("Null 1").effect("Reverse_Direction")("Checkbox") == 1 ? [1, 3] : [0, 2];

    firstLInstances = Math.ceil(stopPoint / 2);

    if (arrIncludes(shortPoints, beginPoint)) {

    theEnd = percentl * firstLInstances + percentL * (stopPoint - firstLInstances);

    } else {

    theEnd = percentL * firstLInstances + percentl * (stopPoint - firstLInstances);

    }

    theEnd = theEnd == 0 ? 100 : theEnd;

    if (thisComp.layer("Null 1").effect("Enable/Disable Loading")("Checkbox") == 1){

    val = linear(time, 0, thisComp.duration - thisComp.frameDuration, 0, theEnd);

    }else{

    val = theEnd

    }

    val

  • Nick Mara

    October 3, 2020 at 10:23 am

    Exploding HeadDizzy FaceExploding HeadDizzy Face

    I’m literally in shock right now.

    Unbelievable.

    I’ve just tried your expression and it works like magic Man Mage

    I couldn’t be happier with the result and I still can’t thank you enough for everything you’ve done.

    I hope you had fun trying to fix this troubles and always finding the right solution.

    Well, you are great Andrei, thank you for taking the time to dive into this project and helping me out.

    If there’s anything I can do for you, please let me knowGrin

  • Andrei Popa

    October 6, 2020 at 8:38 am

    Thanks for the kind words.

    If there’s anything I can do for you, please let me know

    Well, if you need a job in AE automation or know anyone else who needs, you can always reach me at andrei@audaciousleap.com

Page 3 of 3

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