Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Motion Trails with Random Position Seed

  • Motion Trails with Random Position Seed

    Posted by Madli Man on August 3, 2013 at 8:26 pm

    Hi forum,

    Im got expression from Motionscript for motion trails. Everything is working good. But i wanted to add some 3D random position to the follower position by changing slider as a 3D random seed.

    How can i do that?

    Thank you.
    Madli

    delay = 5
    d = delay*thisComp.frameDuration*(index - 1);
    thisComp.layer(1).position.valueAtTime(time - d)

    Madli Man replied 12 years, 9 months ago 3 Members · 5 Replies
  • 5 Replies
  • Darby Edelen

    August 3, 2013 at 10:52 pm

    If you only want to randomly offset the followers in Z you could add something like this to the expression:

    seedRandom(index, true);
    min = -5;
    max = 5;
    z = random(min, max);
    ...current expression... + [0,0,z];

    The expression as you currently have it would go where it says “…current expression…”

    The above would offset each follower by a random amount between -5 and 5 on the Z axis. This offset will be constant per layer.

    Darby Edelen

  • Madli Man

    August 4, 2013 at 1:44 am

    Thank you Darby for quick reply.

    it work perfect. I add-on some expression in it.

    Thank you.

    rand=thisComp.layer("Control").effect("Position Random Seed")("Slider");
    delay = thisComp.layer("Control").effect("Delay")("Slider")
    min = thisComp.layer("Control").effect("Min Position")("Slider");
    max = thisComp.layer("Control").effect("Max Position")("Slider");
    seedRandom(rand, true);
    x = random(min, max);
    y = random(min, max);
    z = random(min, max);
    d = delay*thisComp.frameDuration*(index - 1);
    thisComp.layer(1).position.valueAtTime(time - d)+[x,y,z];

  • Madli Man

    August 9, 2013 at 6:59 pm

    Hi forum,

    Just one more quick question. How can i adjust this random value either min or max value.
    eg:
    min =-180;
    max = 180;
    random either one of these 2 value not between them.

    Thanks forum.

    seedRandom(index, true);
    min = -5;
    max = 5;
    z = random(min, max);
    ...current expression... + [0,0,z];

  • Dan Ebberts

    August 9, 2013 at 7:28 pm

    This should work:

    seedRandom(index, true);
    min = -5;
    max = 5;
    z = random() < .5 ? min : max;
    …current expression… + [0,0,z];

    Dan

  • Madli Man

    August 10, 2013 at 3:36 pm

    Thank you Mr.Dan.

    its worked. Much appreciated. 🙂

    Madli

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