Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Sequencing Brush Strokes!?

  • Sequencing Brush Strokes!?

    Posted by Miren Patel on October 15, 2024 at 3:29 pm

    Hello all!

    I’ve googled this endlessly and can not find anyone with the same issue or a solution to said problem: I’m working on a project where I’m free-hand drawing lots of images using the brush tool in AE. I end up with thousands of brush strokes and I want to animate them on… now this is where the problem is, there doesn’t seem to be any simple way of doing this.

    You can not sequence the layers as they are all brush stroke layers within one layer. I can animate then ‘end %’ and copy and paste this across all the layers, – great so every brush stroke animates at the same time (this isn’t what I want, I want it sequential). This leaves me with manually moving each and every brush stroke layer.

    The other thing I experimented with was the “write-on” function of the brush tool. But this is essentially doing the same thing as the previous method but with more natural animate-on times, but it leaves you in a worse position as every brush stroke disappears before the second stroke when you are trying to draw something out, so it isn’t practical for the actual drawing part 🙁

    Any ideas?

    I’ve attached a photo, you can see I’ve just grabbed chunks at a time and moved each chunk a frame forward as a quick workaround. It’s not ideal. I’m tempted to try and code a plugin to do what I want here. I’m surprised no one has ever asked about this?!

    Miren Patel replied 6 months ago 2 Members · 7 Replies
  • 7 Replies
  • Dan Ebberts

    October 15, 2024 at 11:40 pm

    This is just pretty rough, and likely won’t meet your exact needs, but should give you an idea of possible automation. If you apply an expression like this to the End property of each brush’s Stroke Options:

    tStart = inPoint;
    dur = .75;
    delay = .25;
    t1 = tStart + delay*(thisProperty.propertyGroup(2).propertyIndex - 1);
    t2 = t1 + dur;
    linear(time,t1,t2,0,100)

    It will sequence the brush strokes. Then, instead of adding the expressions by hand, you could use a simple script like this to apply the expression to each brush:

    function addExpression(){
    var myComp = app.project.activeItem;
    if (! (myComp && myComp instanceof CompItem)){
    alert("No comp active.");
    return;
    }
    if (myComp.selectedLayers.length == 0){
    alert ("No Layer Selected.");
    return;
    }
    var myLayer = myComp.selectedLayers[0];
    var myEffects = myLayer.property("ADBE Effect Parade");
    var myPaint;
    var myStrokes;
    var myBrush;
    var expr = 'tStart = inPoint;\r' +
    'dur = .75;\r' +
    'delay = .25;\r' +
    't1 = tStart + delay*(thisProperty.propertyGroup(2).propertyIndex - 1);\r' +
    't2 = t1 + dur;\r' +
    'linear(time,t1,t2,0,100)\r';
    for (var i = 1; i <= myEffects.numProperties; i++){
    if (myEffects.property(i).matchName == "ADBE Paint"){
    myPaint = myEffects.property("ADBE Paint");
    myStrokes = myPaint.property("ADBE Paint Group");
    for (var i = 1; i <= myStrokes.numProperties; i ++){
    if (myStrokes.property(i).matchName == "ADBE Paint Atom"){
    myStrokes.property(i).property("ADBE Paint Properties").property("ADBE Paint End").expression = expr;
    }
    }
    }
    }
    }
    addExpression();

    I hope that’s helpful.

  • Miren Patel

    October 16, 2024 at 10:45 pm

    I hate you for making me realise I didn’t think about making an expression.

    Thank you, you genius.

    Tbf I wouldn’t have thought about “property index”

    I tried the script, it seems to come up with an error, but the expression works absolutely fine, I have no problem doing ‘copy expression only’ – cmdA – cmdV

    Thanks!!

  • Miren Patel

    October 16, 2024 at 11:02 pm

    The only thing – putting this into practice, is that all the brush strokes animate on backward (in terms of when they were drawn) trying to figure out if there is a way to change the expression slightly so that it sequences them the other way around.

    maybe finding the total number of propertyindex’s and then subtracting the property index with the total number to get a new number

  • Dan Ebberts

    October 17, 2024 at 12:57 am

    Yes, so probably like this:

    tStart = inPoint;
    dur = .75;
    delay = .25;
    t1 = tStart + delay*(thisProperty.propertyGroup(3).numProperties - thisProperty.propertyGroup(2).propertyIndex);
    t2 = t1 + dur;
    linear(time,t1,t2,0,100)
  • Dan Ebberts

    October 17, 2024 at 12:59 am

    Also, would love to know what error message you’re running into with the script.

  • Miren Patel

    October 25, 2024 at 11:04 am

    Hi Dan, sorry for late reply – this is the error

  • Miren Patel

    October 25, 2024 at 11:13 am

    This was the final expression I used:

    haha I just realised reading through it, I have a very redundant “+1” and then “-1”

    same as what you had basically but with the redundancy haha

    tStart = inPoint;

    dur = effect("Duration")("Slider");

    delay = effect("Delay")("Slider");

    totalStrokes = thisProperty.propertyGroup(3).numProperties;

    reversedIndex = totalStrokes - thisProperty.propertyGroup(2).propertyIndex + 1;

    t1 = tStart + delay * (reversedIndex - 1);

    t2 = t1 + dur;

    linear(time,t1,t2,0,100)

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