Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animating several brush stroke offset time expression

  • Animating several brush stroke offset time expression

    Posted by Igor Renzetti on October 7, 2010 at 11:24 am

    Hello everybody, I’m trying to animate a paint on effect on a layer with paint effect applyed.
    I drew the subject without the write on option and now I have 1518 brush strokes in the effect.
    I’d like to offset in time the property end keyframing of each stroke with an expression that uses the previous stroke timing to offset the current.
    I tried with this expression applyed on the end property of the second stroke
    effect("Paint").stroke("Brush 1518").strokeOption.end.valueAtTime(time-framesToTime(50));
    that works between the stroke n°1517 and n°1518
    I’d like to use this expression indexing the strokes in a way like using index-1 to apply the same expression to all the strokes at once and so it has to work with an indexing behaviour
    This one naturally doesn’t works
    effect("Paint").stroke(propertyIndex-1).strokeOption.end.valueAtTime(time-framesToTime(50));

    May someone more expert than me can figure it out?
    Thank you in advance
    Igor

    Dan Ebberts replied 11 years, 4 months ago 3 Members · 16 Replies
  • 16 Replies
  • Dan Ebberts

    October 7, 2010 at 4:36 pm

    I think you’re looking for something like this:

    myIdx = thisProperty.propertyGroup(2).propertyIndex;
    effect(“Paint”).stroke(myIdx-1).strokeOption.end.valueAtTime(time-framesToTime(50));

    Dan

  • Igor Renzetti

    October 8, 2010 at 11:46 pm

    Thank you Dan, it is what I was looking for!!
    It works well with few brush strokes. If i apply it to all the strokes I recive a Stack overrun error and the expression becomes disabled from AE.
    What can I do? I have totally 1518 brush strokes.
    Thank you again
    Greets
    Igor

  • Dan Ebberts

    October 9, 2010 at 12:12 am

    It might be the cascading effect of having one expression refer to the previous brush, which refers to the previous brush, etc. I would try modifying the expression so that instead of referring to the previous brush, they all refer to the first brush and base the time delay on the delta in property indexes between the first brush and the brush with the expression. I’m not sure that will solve the problem, but it’s worth a try.

    Dan

  • Igor Renzetti

    October 9, 2010 at 12:57 pm

    I think that this would be the best thing to do.
    Unfortunately I’m not so good with expression writing and I don’t know well how to write this variation in the expression.


    delta= effect("Paint").stroke("Brush 1518").strokeOption.end.valueAtTime;
    effect("Paint").stroke(effect("Paint").stroke("Brush 1518").strokeOption.end).strokeOption.end.valueAtTime(time+framesToTime(delta);

    tried this but doesn’t work…
    Thank you Dan for your help

  • Dan Ebberts

    October 9, 2010 at 5:05 pm

    Assuming that Brush 1518 is at the top of the brush stack (in the Timeline panel), it would look like this:

    L = effect(“Paint”).stroke(“Brush 1518”);
    myIdx = thisProperty.propertyGroup(2).propertyIndex;
    delta = myIdx – L.propertyIndex;
    L.strokeOption.end.valueAtTime(time-framesToTime(delta*50));

    Dan

  • Igor Renzetti

    October 9, 2010 at 6:32 pm

    Thank you very much Dan, it works very well!!!!
    Cheers!

  • Dan Ebberts

    October 9, 2010 at 6:41 pm

    Does it eliminate the stack overrun error?

    Dan

  • Igor Renzetti

    October 9, 2010 at 11:46 pm

    Yes it does. No more stack overrun error.
    All the 1518 strokes follow the expression drawing themselves after the number of frames specified relatively each other.
    Naturally time consuming computation is needed.

  • John Mangual

    April 1, 2015 at 10:32 pm

    Can this be updated for CS6?

  • Dan Ebberts

    April 1, 2015 at 11:26 pm

    I’m sorry, what do you mean?

    Dan

Page 1 of 2

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