Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression problem

  • Expression problem

    Posted by Marius Shekow on August 7, 2005 at 12:24 pm

    hiho. I want to have a layer to start wiggling more on more. but wiggling shall not start before 2.33 sec (2 sec 10 frames)

    so I scripted this expression for the position of the layer:
    amp=(time-2.333)*10; // once 2.33 secs are reached the value amp increases from 0 => x
    if (amp >= 0) // once 2.33 secs have passed wiggling shall start, but not before 2.33 sec (amp has negative values before 2.33 sec)
    {
    wiggle(15,amp);
    }

    But AE doesn’t get this to work because it says there hast to be a dimension of “2” instead of “1”…

    anyone can help ?

    Rich Rubasch replied 20 years, 9 months ago 3 Members · 4 Replies
  • 4 Replies
  • Eric

    August 7, 2005 at 12:59 pm

    hi,

    the problem is that the expression you wrote returns only one value. the position property requires two (x and y).

    may be this is a solution for you:

    add two expression slider controls to the layer which you wish to wiggle.
    name the first one “wiggle” and apply the wiggle expression and adjust the values.
    name the second one “factor”. this slider will control the amount of wiggle added
    to the position property.

    now add this expression to the position property:
    w = effect(“wiggle”)(“Slider”); //retrieves the wiggle
    f = effect(“factor”)(“Slider”); //amount of wiggle

    [position[0] + (w * f), position[1] + (w * f)]

    the last step is classic keyframing. set the factor value to zero where no wiggle should
    be applied and set a keyframe. go to the time where the wiggle should have an effect
    and set the factor value to whatever you want.

    the factor value gives you the full control over how wiggly the layer should behave.

    cheers
    eric

  • Marius Shekow

    August 7, 2005 at 2:15 pm

    ah, thx very much. I didn’t realize how easy it could be using a slider.

    But I found and even simpler solution:

    just apply one slider (for the amount, the “amp”) to the layer that shall be wiggled. animate this slider and declare the slider as “amp”.
    code looks like the following:

    seedRandom(221, timeless = false);
    amp=effect(“amount-slider”)(“Slider”);
    wiggle(15,amp)

    this works perfectly!

  • Eric

    August 7, 2005 at 2:38 pm

    yes that’s smarter. i keep that for my records ; )

  • Rich Rubasch

    August 7, 2005 at 5:46 pm

    Did I mention I hate expressions? Just loathe the things. Yuck.

    Man, I gotta learn expressions.

    I just gotta learn those darn things.

    I just don’t like expressions…

    Must…learn……..them…..

    Rich Rubasch
    Tilt Media

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