Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Make multiple layers move in random spirals

  • Make multiple layers move in random spirals

    Posted by Ari Valen levinson on September 25, 2020 at 9:38 pm

    Hey folks, I’m trying to figure out how to get a large collection of (200+) layers to randomly spiral in in 3D space to their final resting points.

    Each layer has a unique final position on a 2D plane, and I’d like them to all start at random points in 3D space and move to their final position. All fine so far: I can do this with some random values and the “linear” expression.

    The trick comes in when I want them to all move around curved paths. I’d like each one to move in an arced path. Now “linear” doesn’t work. Anyone have any suggestions about the most painless way to accomplish this?

    Filip Vandueren replied 5 years, 7 months ago 4 Members · 3 Replies
  • 3 Replies
  • Michael Szalapski

    September 25, 2020 at 10:11 pm

    Do you have Cinema 4D? Because it would be a lot easier with it.

  • Andrew Somers

    September 25, 2020 at 10:21 pm

    Hey Ari, how ya been?

    If you want them all to have nice arcs, an expression with javascript Math.sin(); is the down and dirty way. Or use a spreadsheet like LibreOffice (it’s free) , since you can cut and past keyframes from and to the timeline and a spreadsheet, that’s an easy way to handle math tricks.


    Cheers,

    Andy


  • Filip Vandueren

    September 27, 2020 at 11:32 am

    As is often the case, if you think about animating not the position but the anchorpoint of the layer, it becomes much easier.

    I created a 3D-Null that served as the spiral center.

    Other 3D layers were positioned in 3D space (randomly, but you can put them at your desired end-locations manually).

    Now, if each of those layers would have it’s anchorPoint “moved” to the spiral center it would be a simple matter of rotating them all around their desired axis and you would have an orbit. If the anchorpoint would change to gete close away while orbiting, you get a spiral.

    I used these expressions on every 3D layer:

    position:

    ctr = thisComp.layer("Spiral center");
    seedRandom(index,true);
    time>-100 ? ctr.position : random([0,0,-1000],[1920,1080,1000]);

    If you need specific keyframed ending positions, not random ending positions change the last line to: time>-100 ? ctr.position : value;

    The trick here is that we actually just position the layer at the spiral center, it’s apparant position will be a result of manipulating the anchorPoint value. but we need a way to reference the actual position of the layer before expressions were applied, so we “hide” that value at negative times <=-100.

    (Note that if everything can be random, we don’t need this, everything could be setup in the anchorPoint expression, and this would simply be ctr.position. But I got the impression from your post that the end-positions were deliberately chosen.)

    anchorPoint:

    seedRandom(index,true);
    ctr = thisComp.layer("Spiral center");
    endPos = ctr.position - thisLayer.position.valueAtTime(-100);
    startPos = endPos * random(2,8);
    easeOut(time, 0, 4, startPos, endPos);

    Notice that the startPoint is not just another random value, but a random amount further away from the anchorpoint. This gives a true spiralling effect. But using a random Number gives an equally interesting, more chaotic effect where each layer follows it’s own spiral (seee second gif)

    Z-rotation (or any other axis/axes you want to rotate around):

    <pre class=””>seedRandom(index,true);
    easeOut(time,0,4,random(90,180),0);

    I’ve kept the values all in the same direction in this example just to make it a bit more clear that it’s spiraling in the GIF, but you can make it as chaotic as you want

    you’ll probably want to add some randomness to the timing instead of 0-4, but I think you know how to handle that.

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