ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How to change Ellipse size to random number within range on second keyframe?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Louis Hamwey
How to change Ellipse size to random number within range on second keyframe?
on Jul 27, 2018 at 4:17:41 pm

I have about 100 ellipses. I need them all to grow or shrink in size randomly all within a 50% range. I also need this to happen starting at 6 secs and ending at 8 secs with ease in and out. Ideally they start and end of the motion would be connected to Keyframes. I have scoured the internet trying to find a solution, but cannot figure it out. Any one have any ideas? Thanks!


Return to posts index

Andreas Brand
Re: How to change Ellipse size to random number within range on second keyframe?
on Jul 27, 2018 at 6:08:36 pm

Hello Louis

this code should work.

Copy it to the scale-property of one of the elipses. Then right-click to the scale-property and chosse "copy expression only".

Then select all other elipses and ctrl+v.

Hope that helps
Andreas

//This takes the markers of the comp
var beginning = thisComp.marker.key(1).time;
var ending = thisComp.marker.key(2).time;

var shrinkFrom = 50;
var shrinkTo = 150;

seedRandom(index, true);
randomShrinkSize = random(shrinkFrom, shrinkTo);

var newScale = linear(time, beginning, ending, 100, randomShrinkSize);

[newScale, newScale]


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]