Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Adding wiggle to an array

  • Adding wiggle to an array

    Posted by David Wiffen on November 19, 2010 at 5:52 pm

    Hi Everyone,

    I am using particular to create a stream of particles following a light named “Emitter” generated from c4d.

    I have the below expression placed on the Position XY of my particular emitter so it follows the light called Emitter. I know there’s a setting for this in particular but I want more flexibility down the line.

    posx = thisComp.layer(“Emitter”).transform.position[0];
    posy = thisComp.layer(“Emitter”).transform.position[1];
    [posx, posy];

    My question is: I want to now add a wiggle expression to both posx and posy separately. Everyway i try to do this, it forgets the array values generated by the (“Emitter’) coordinates and reverts back to its original coordinates.

    All I want to do is ADD the wiggle value onto the x and y value being generated form the (“Emitter’) values.

    I know I can do this with nulls but I want to contain it within this one expression so I can duplicate up the layer and each layer have random wiggle values.

    Many thanks in advance.

    David Wiffen replied 15 years, 8 months ago 3 Members · 7 Replies
  • 7 Replies
  • Kevin Camp

    November 19, 2010 at 6:18 pm

    if there is a reason you can’t add the wiggle to the light’s position, then you could just add it to the last line…

    [posx, posy] + wiggle(5,30)

    however, you’ll need to set the emitter’s xy position to 0,0…

    or maybe you could do that in the expression:

    [posx, posy] – value + wiggle(5,30)

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • David Wiffen

    November 19, 2010 at 8:09 pm

    Thanks for the reply.

    Yeah I can’t put the wiggle on the light as I want to keep that a constant value and run multiple particular layers from it, that are then randomly wiggled. So the effect would be multiple particular light streaks with random wobbles away from the lights path.

    Does that make sense? Would your expression work for that?

  • Kevin Camp

    November 19, 2010 at 8:39 pm

    [David Wiffen] “Would your expression work for that?”

    yep, they should… reply back if it doesn’t work as expected.

    also, if you needed the same expression on z position, adding -value+wiggle() in a similar way should work.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • David Wiffen

    November 19, 2010 at 8:58 pm

    Great thanks, I’ll have a go when I’m back at work on Monday 🙂

    Thanks for your help!

  • Dan Ebberts

    November 19, 2010 at 9:47 pm

    You can get a wiggled version of the light’s position from within the Particular layer’s xy property like this:

    thisComp.layer(“Emitter”).transform.position.wiggle(1,50)

    and the result will be different for each Particular layer. I’m not sure if that does everything you need because of your requirement to split the dimensions though.

    Dan

  • David Wiffen

    November 22, 2010 at 9:49 am

    Thanks Kevin,

    -value+wiggle() worked a treat!

    Would there be a way to separate the x and y values? i.e. so if I wanted to wiggle the y more?

    here’s the expression as it stands – the wiggle is attached to a sliders etc…

    posx = thisComp.layer(“Emitter”).transform.position[0];
    posy = thisComp.layer(“Emitter”).transform.position[1];
    [posx, posy] – value + wiggle(thisComp.layer(“Wiggle1”).effect(“Freq”)(“Slider”),thisComp.layer(“Wiggle1”).effect(“Amp”)(“Slider”));

    Any help much appreciated

  • David Wiffen

    November 22, 2010 at 4:19 pm

    Sorry Dan, only just saw this post. Yes this works great to separate up the x and y.
    Thanks!

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