Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Wiggling in Particular

  • Wiggling in Particular

    Posted by Nick Hill on April 4, 2008 at 11:24 am

    Hi all

    I’m trying to get some light streaks (as in Andrew Kramer’s great tutorial) to wiggle around the position of a null object in Particular. My expression is this:

    x = thisComp.layer(“EmitNull”).transform.position[0];
    y = thisComp.layer(“EmitNull”).transform.position[1];
    wa = thisComp.layer(“EmitNull”).effect(“WiggleAmt”)(“Slider”);
    wf = thisComp.layer(“EmitNull”).effect(“WiggleFreq”)(“Slider”);
    w = wiggle(wf, wa);
    x += w[0];
    y += w[1];
    [x, y]

    WiggleAmt and WiggleFreq are just two sliders I set up to make things easier to control. This works, *BUT* for some reason the light streaks appear about 345 pixels to the right of the null object. Nothing’s parented to anything else. The comp is 836 x 24 pixels and it doesn’t seem to affect the Y position. Any ideas?

    Cheers

    Nick

    Nick Hill replied 18 years, 1 month ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    April 4, 2008 at 1:15 pm

    The problem is that if you don’t specify a property to wiggle the result of wiggle() includes the value of the property you have the expression is applied to. So you can either subtract that out, like this:

    x = thisComp.layer(“EmitNull”).transform.position[0];
    y = thisComp.layer(“EmitNull”).transform.position[1];
    wa = thisComp.layer(“EmitNull”).effect(“WiggleAmt”)(“Slider”);
    wf = thisComp.layer(“EmitNull”).effect(“WiggleFreq”)(“Slider”);
    w = wiggle(wf, wa) – value;
    x += w[0];
    y += w[1];
    [x, y]

    Or just wiggle the emitter’s position directly, like this:

    P = thisComp.layer(“EmitNull”).transform.position;
    wa = thisComp.layer(“EmitNull”).effect(“WiggleAmt”)(“Slider”);
    wf = thisComp.layer(“EmitNull”).effect(“WiggleFreq”)(“Slider”);
    P.wiggle(wf, wa);

    Dan

  • Nick Hill

    April 5, 2008 at 1:15 pm

    Aha – I thought it’d be something like that. Thanks very much for demystifying!

    Cheers

    Nick

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