Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Dan Ebberts – help

  • Dan Ebberts – help

    Posted by Pedro Reynoso on March 24, 2007 at 9:20 pm

    I modified an expression you provided to another forum visitor to distribute layers in 3d space. Apparently I didn’t do a good job modifying it for ae 5.5. Can you please help me?

    Here is the code:

    Seed_random(index,true);
    xVal = this_comp.layer(“Center”).transform.position[0]+random(-10000, 10000);
    yVal = this_comp.layer(“Center”).transform.position[1]+random(-10000, 10000);
    zVal = this_comp.layer(“Center”).transform.position[2]+random(-10000, 10000);
    [xVal,yVal,zVal]

    THANK YOU THANK YOU

    Pedro Reynoso replied 19 years, 6 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    March 24, 2007 at 10:09 pm

    This should do it:

    seed_random(index,true);
    xVal = this_comp.layer(“Center”).position[0]+random(-10000, 10000);
    yVal = this_comp.layer(“Center”).position[1]+random(-10000, 10000);
    zVal = this_comp.layer(“Center”).position[2]+random(-10000, 10000);
    [xVal,yVal,zVal]

    Dan

  • Pedro Reynoso

    March 24, 2007 at 11:17 pm

    Thank you very much. The expression worked fine. However it placed the pictures very far away out of range of the comp. Is there any modifications I can make to keep the placement within a certain perimeter? I don

  • Dan Ebberts

    March 24, 2007 at 11:33 pm

    Just change the random min and max. This should give you the idea:

    seed_random(index,true);
    xVal = this_comp.layer(“Center”).position[0]+random(-400, 400);
    yVal = this_comp.layer(“Center”).position[1]+random(-400, 400);
    zVal = this_comp.layer(“Center”).position[2]+random(-400, 400);
    [xVal,yVal,zVal]

    In newer versions of AE you can copy just an expression and paste it onto a bunch of layers at once. In 5.5 you might be able apply it to a transform effect and make a preset out of it, but I don’t remember if all the necessary pieces exist in 5.5.

    Dan

  • Pedro Reynoso

    March 24, 2007 at 11:37 pm

    Thank you very much for your promptness and your expertise in this area. What would we do without you. You are great.

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