Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions random() generates a different number after closing and opening AE again

  • random() generates a different number after closing and opening AE again

    Posted by Dino Muhic on December 9, 2010 at 12:51 pm

    Hi,

    I have layers which are positioned at specific coordinates and which implode into the destined coordinate from a random point in space. Imagine a reversed explosion.
    The camera should fly through the randomly placed layers at the beginning

    Since there are a lot of layers I wanted to position them randomly and made a script using random() but after I closed the project and opened it again, the random values where different then before.

    is there a way to place them randomly and let them implode but in a way where they STAY at the value they got assigned to?

    I assume I need to “bake” the randomly generated numbers but dont know how.

    I don’t mean using seedRandom(index,true)! My problem is, that I animated the camera through the randomly generated layers and after restarting they were at different positions and I had to animate the camera again and again.

    Any ideas?

    Thanks

    Kevin Camp replied 15 years, 5 months ago 3 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    December 9, 2010 at 2:14 pm

    It would help to see your expression.

    Dan

  • Dino Muhic

    December 9, 2010 at 2:22 pm

    Hi Dan,

    I have a Null object with a slider which controls the “explosion”, the code below is in the position value of all layers.

    I got the same for all rotation axes

    seedRandom(index,true);

    add= thisComp.layer("Null 1").effect("Dispersion")("Slider");
    xVal =transform.position[0]+random(add*-1, add);
    yVal = transform.position[1]+random(add*-1, add);
    zVal = transform.position[2]+random(add*-1, add);
    [xVal,yVal,zVal]

    Dino Muhic – Media Producer
    VFX – Motion Graphics – Web-Design – Or just ART
    http://www.dinomuhic.com

  • Dan Ebberts

    December 9, 2010 at 2:55 pm

    I don’t get that behavior on just saving and reopening the project. However, if you make any changes to the number of layers all your random values will move around. One note on your expression – I wouldn’t use “add” as a variable name because there is already a vector math operator named “add”. I think your expression can be simplified to this:

    seedRandom(index,true);
    d= thisComp.layer(“Null 1”).effect(“Dispersion”)(“Slider”);
    value + random([-d,-d,-d],[d,d,d])

    Dan

  • Kevin Camp

    December 9, 2010 at 4:28 pm

    also, if you want to bake the expression values, you could use animation>key frame assistant>convert expression to keyframes

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

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