Highlighted

Random beginning key frame expression to final position

New Here ,
Apr 15, 2020

Copy link to clipboard

Copied

Hi all, 
I am new to writing expressions, I only know the basic ones.

I have been trying to figure out a simple way to create a loading map animation. I have this map created out of a bunch of different squares (about 1700 layers) and I want them to start at random positions and then come together to create the final image. I could do this by manually setting random initial keyframes but with 1700 layers, it is very tedious. Anyone know a way I can do this with an expression and could explain the expression to me so I can learn how to do it next time? Thanks!Screen Shot 2020-04-15 at 9.00.45 AM.png

Topics

Expressions, How to, Scripting

Views

254

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Random beginning key frame expression to final position

New Here ,
Apr 15, 2020

Copy link to clipboard

Copied

Hi all, 
I am new to writing expressions, I only know the basic ones.

I have been trying to figure out a simple way to create a loading map animation. I have this map created out of a bunch of different squares (about 1700 layers) and I want them to start at random positions and then come together to create the final image. I could do this by manually setting random initial keyframes but with 1700 layers, it is very tedious. Anyone know a way I can do this with an expression and could explain the expression to me so I can learn how to do it next time? Thanks!Screen Shot 2020-04-15 at 9.00.45 AM.png

Topics

Expressions, How to, Scripting

Views

255

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 15, 2020 0
Most Valuable Participant ,
Apr 15, 2020

Copy link to clipboard

Copied

Something like that perhaps:

 

mOutside=250; //padding outside comp view

seedRandom(index,true);
mRand=random(-mOutside*0.5;mOutside*0.5);

mHalfX=Math.round(thisComp.width%position[0]);
mHalfY=Math.round(thisComp.height%position[1]);

if(mHalfX != 0)
{startX=thisComp.width+mRand}
else
{startX=-mRand);

if(mHalfY != 0)
{startY=thisComp.height+mRand}
else
{startY=-mRand);

timeStart=0;
timeEnd=0.5;

X=linear(time,timeStart,timeEnd,startX, position[0]);
Y=linear(time,timeStart,timeEnd,startY, position[1]);

[X,Y]

 

This is cobbled together on the fly and untested, so errors may occur.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 15, 2020 0
Adobe Community Professional ,
Apr 15, 2020

Copy link to clipboard

Copied

With 1700 layers you are going to run out of the ability to see all of them in the timeline. If you want to stick to the idea that all dots are on a separate layer you will have to pre-compose. 

I would use a dozen or so shape layers with Mylenium's expression on each dot's transform property. This would be really easy to do if you created the original art in illustrator on ten or twelve layers and then converted the layers to shapes in AE.

 

Even easier: Apply Card Dance to the image above and line up the grid with the little squares. That would take about five minutes to set up and only require two layers, a gradient, and the image.

 

Here's your image, a pre-composed Fractal Noise layer as a gradient, and Card Dance with Z position controlled by a multiplier and offset. Two layers, one of them a pre-comp with Fractal Noise and Levels applied, 2 keyframes set on Z position multiplier  and about  5 minutes work and you get this:

CardDance.gif

A couple more keyframes on a couple of other properties and maybe some animation on the fractal noise layer and you could have particles flying into position from all over the place. The hardest part of the project was finding the right number of rows and columns for Card Dance.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 15, 2020 0
Adobe Community Professional ,
Apr 15, 2020

Copy link to clipboard

Copied

A Particle system would do this in a fraction of the time. Google "Particle Playground" to do this without 3rd party plugins and Particular/Form/Stardust for 3rd party solutions.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 15, 2020 0