Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Impossible expression

  • Impossible expression

    Posted by Gerardo Morales on April 29, 2009 at 7:34 pm

    Hello fellow animators,

    I have this problem which is troubling my mind beyond sanity. I’m trying to blow up an object composed of many layers and elements. I want to use the same expression, maybe with variations (2 or 3) for all the layers in the position attribute.

    First I came up with this expression:

    randomfactor= random(1, 10);
    pos= 1
    neg= -1
    slider=thisComp.layer(“slider”).effect(“Slider Control”)(“Slider”);

    x= value[0]+neg*randomfactor*slider;
    y=value[1]+neg*randomfactor*slider;
    z=value[2]+pos*randomfactor*slider;

    [x,y,z]

    But it didn’t work as I wanted to, because the random function makes the animation jumpy.

    Then tried this one:

    factor= 15;
    pos= 1
    neg= -1
    slider=thisComp.layer(“slider”).effect(“Slider Control”)(“Slider”);

    x= value[0]+neg*factor*slider;
    y=value[1]+neg*factor*slider;
    z=value[2]+pos*factor*slider;

    [x,y,z]

    But it was to predictable and the explosion didn’t seem random.

    I think what I really need is a way to produce a random factor to use in the first equation instead of the random function, that way a random number is produced for each layer at the first frame and used for the duration of the animation instead of generating random numbers every frame.

    Anyone know of a way to produce and hold this random number? Or maybe a better solution for this effect?

    Thank you,
    Gerardo.

    Gerardo Morales replied 17 years, 4 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    April 29, 2009 at 8:14 pm

    Start your expression with:

    seedRandom(index,true);

    Dan

  • Gerardo Morales

    April 29, 2009 at 9:17 pm

    Worked like a charm.

    Thanks Dan.

    Gerardo

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