Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Animating scale of multiple groups within a shape layer in a random configuration

  • Animating scale of multiple groups within a shape layer in a random configuration

    Posted by Jackson Davis on April 27, 2017 at 3:17 pm

    Hello there,

    So I have a world map vector constructed of circles, imported into AE, converted to a shape layer. I now have 1 shape layer (called ‘map’) containing 735 groups (each being a separate circle, named ‘Group 1’, ‘Group 2’ etc).

    I would like to have the map transition into the frame by each circle scaling from 0-100%, but in a random, staggered order. As opposed to all of them scaling at the same time. Ordinarily, I would do this manually, but with there being 735 groups this obviously isn’t a sensible idea.

    I’ve never really worked with any expressions beyond the basics, so I’m pretty excited to delve into this section of AE and utilise them properly.

    Many thanks in advance, I have tried to find a solution elsewhere, but unfortunately I haven’t found anything (maybe I’m looking in the wrong place)

    Jackson Davis replied 9 years ago 3 Members · 6 Replies
  • 6 Replies
  • Steve Sierra

    April 27, 2017 at 6:06 pm

    Hi,

    You can put this in every group’s transform/scale :

    var minGoTime=0;
    var maxGoTime =5;
    seedRandom(800, true);
    var goTime = random(minGoTime ,maxGoTime );
    var spd = 10;
    var a = clamp((time-goTime)*spd, 0, 100);

    if(time

  • Dan Ebberts

    April 27, 2017 at 6:26 pm

    Play around with this:

    minStart = 0;
    maxStart = 2;
    rampDur = .25;
    n = parseInt(thisProperty.propertyGroup(2).name.split(” “)[1],10);
    seedRandom(n,true);
    myStart = random(minStart,maxStart);
    ease(time,myStart,myStart+rampDur,[0,0],[100,100])

    Dan

  • Steve Sierra

    April 28, 2017 at 3:52 am

    Hi Dan,

    Could you quickly explain what parseInt does ?
    I read it takes a string and turns it into an int ? How ? What does the base 10 do ?

    Thanks !
    😉

  • Dan Ebberts

    April 28, 2017 at 6:20 am

    >I read it takes a string and turns it into an int

    That’s what it does. It will parse the string from left to right until it reaches the end of the string or a character that doesn’t translate to an integer. So “23x” would parse as 23, as would “23.123”. If the first character can’t be parsed ( “x123”, for example) parseInt returns NaN (not a number) and you should check for this using isNaN() if that’s a possibility with your set up. The 10 just ensures that the string is interpreted as a base 10 number.

    Dan

  • Steve Sierra

    April 28, 2017 at 7:10 am

    I see,

    I was confused, thinking it might turn “a” to “1”, “b” to “2”, “c” to “3”, etc…

    Thanks for the lesson !
    😉

  • Jackson Davis

    April 28, 2017 at 7:54 am

    Thanks for your help guys, I really appreciate it.

    Dan, your method is working like a charm – Exactly what I was looking for. Thank you also for the explanation.

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