Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Making a loopOut happen at random times?

  • Making a loopOut happen at random times?

    Posted by Erin Shelby on January 22, 2007 at 1:51 am

    I have a comp where there is a simple mask animation on a solid layer. The keyframes are on frames 1, 3, and 6 (frames one and six are identical). I was wondering if I could make this animation happen randomly throughout the comp.

    I will clarify more if needed. TIA.

    -E

    Dan Ebberts replied 19 years, 3 months ago 2 Members · 7 Replies
  • 7 Replies
  • Erin Shelby

    January 22, 2007 at 1:54 am

    I wonder if I could add something else…which is that if I had more animations on that layer, lets say keyframes at 10, 13, and 16 (10 and 16 are identical to 1 and 6). If I could write an expression to play one of the loops at random at random times.

    Again, I will clarify if needed. Thanks.

    -E

  • Dan Ebberts

    January 22, 2007 at 4:18 am

    What happens between those random times?

    Dan

  • Erin Shelby

    January 22, 2007 at 6:26 am

    > What happens between those random times?

    Nothing. So the end effect is that what I’ve keyframed happens randomly, with periods of nothing (resting position [keyframes 1 + 6, in my example]) in between.

  • Dan Ebberts

    January 22, 2007 at 3:15 pm

    I think I’d precompose your animation layer (move all attributes), enable time remapping, and apply a time remapping expression like this:

    minDelay = 2;
    maxDelay = 4;
    seedRandom(index,true);
    t = 0;
    d = 0;
    while (t < time){ d = random(minDelay, maxDelay); t += d; } if (time < d) 0 else time - t + d Dan

  • Erin Shelby

    January 22, 2007 at 6:31 pm

    I guess precomposing would make the most sense. I’ll try it out and post the results – thanks!

    -E

  • Erin Shelby

    January 22, 2007 at 9:30 pm

    Hey Dan, your expression worked well thanks for the help.

    Slightly related, I was looking at your drummer/marker tutorial and it’s very cool. I was wondering if your arm animation in your demo had multiple different types of animation (ie: The right hand hits the drum between frames 1-10, and between frames 11-20 it flipped the drumstick in the air, and between 21-30 it did something else) – what do you think the best way would be to make a system that you could reference each animation “instance”. I was thinking maybe your marker system would work if adapted slightly (you can comment on markers, so perhaps different markers could have different comments. ie: “drumhit”, “drumstick_twirl”, etc. But I’m not sure if you can write expressions to check the comments of a marker…).

    Essentially, I’m trying to figure out a system to character animate a bit easier then just swapping out heads, ligaments, etc.

  • Dan Ebberts

    January 22, 2007 at 10:09 pm

    Unfortunately, at this time an expression can’t access a marker’s comment. However, it can get a marker’s time. So, with a little modification, I think you could set up your animations and apply markers where each animation starts. Then you could have a Slider where you use hold keyframes to set the marker number of the animation that you want to sync to the Slider keyframe. The expression would be somewhat more complicated (you’d have to make sure you didn’t run over into the next animation), but I don’t see any reason that it wouldn’t work.

    Dan

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