Activity › Forums › Adobe After Effects › Expression for Random placement of layers in z and x depth but all the same y ?
-
Expression for Random placement of layers in z and x depth but all the same y ?
Posted by Jack Hilkewich on December 11, 2006 at 5:59 amI have not the brain for the writing of expressions. Can someone please help a poor guy out?
Thanks!
Jack Hilkewich replied 19 years, 5 months ago 3 Members · 5 Replies -
5 Replies
-
Mike Clasby
December 11, 2006 at 6:21 amHere’s a hack from a Colin expression, on position of a 3D layer:
minX = -500;//Minimum x depth value
maxX = 1000;//Maximum x depth value
minZ = -500;//Minimum z depth value
maxZ = 2000;//Maximum z depth value
seedRandom(index, true);
x = random(minX,maxX);
z = random(minZ, maxZ);
[Math.round( x), position[1], Math.round( z )]Change the numbers (pixels) to spread or narrow the field, you could set up a slider on a null and easily change the spread. The Z is -500 so it falls in front of the default camera.
Here’s Colin’s original post, it was for Random Z:
https://forums.creativecow.net/cgi-bin/new_read_post.cgi?forumid=2&postid=879394
-
Mylenium
December 11, 2006 at 6:44 amAnswered this at CGTalk. Please do not cross-post in the future. It’s simply inefficient to take away from two people’s free time when one could do the job just as well. ;O) Thanks.
Mylenium
[Pour Myl
-
Mike Clasby
December 11, 2006 at 6:58 amTo answer you second question (Mylenium’s other mentioned forum), you can apply expressions on a mass basis by selecting the expression (position here) then Edit>Copy Expression only, then select as many layers (100’s ?) as you want to have the expression, and Paste.
-
Mylenium
December 11, 2006 at 7:01 amThanks yikes, completely overlooked that. ;O)
Mylenium
[Pour Myl
-
Jack Hilkewich
December 11, 2006 at 6:50 pmThanks for the answer guys!
As for cross posting, I tend to disagree with you on this one, Mylenium. If I am researching for an answer to a question and I only post to one forum and then wait until I get an answer from that one forum that would not be very efficient. A number of people that use Cgtalk may not utilize Creative Cow and vice versa. This allows me to get the most mileage out of a problem’s solution by getting a larger amount of different people responding. Especially if you are working on a contract with a client waiting for his ad , time is very important.
I do however try not to double post on the same forum.
I mean no disrespect with this post.
Thanks for all your help!
Reply to this Discussion! Login or Sign Up