ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Random positions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jorge Lavín
Random positions
on Sep 21, 2011 at 4:20:37 pm

Hey everyone.

This is my firts question as I am new to After effects and found this forum.

Well, I have a composition with many layers (more than 200 pics) I needed to spread them appart so I used this expression in each one:


range = 10000;
x = random(-range,range);
y = random(-range,range);
z = random(-range/2,range/2);
[x,y,z];

The thing is I want them to stay in that position, but I found that they change every frame. How can I resolve this?

Thank you.

range = 10000;
x = random(-range,range);
y = random(-range,range);
z = random(-range/2,range/2);
[x,y,z];


Return to posts index

Dan Ebberts
Re: Random positions
on Sep 21, 2011 at 5:10:09 pm

Just add this as the first line of the expression:

seedRandom(index,true);

Dan



Return to posts index

Jorge Lavín
Re: Random positions
on Sep 21, 2011 at 10:01:54 pm

Thanx Dan, it worked!

Now I have another problem :P

hope someone can help me, what I want to do now is to convert the random values generated with constant numbers since I made some camera moves over the spreaded pics, saved the proyect and (I really dont remember if I closed it and opened it again) the values changed, I mean the pics are now on different locations.

Thank you again


Return to posts index


Dan Ebberts
Re: Random positions
on Sep 21, 2011 at 11:02:47 pm

That will happen if you add new layers above the ones with the expression.

You can always select the position property, and then Animation > Keyframe Assistant > Convert Expression to Keyframes. You can then delete the keyframes if you want.

Dan



Return to posts index

Jorge Lavín
Re: Random positions
on Sep 21, 2011 at 11:16:45 pm

Thank u again Dan!


Return to posts index

Amy Young
Re: Random positions
on Apr 15, 2017 at 9:40:55 pm

Thanks Dan! Neato!


Return to posts index

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