Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expressions question

  • Expressions question

    Posted by Joshua Stanley on August 23, 2005 at 3:38 pm

    I asked this question below, but it was kind of buried at the end of a question so I didnt get any response.

    I was messing with the code that George Polevoy had posted to create a spring between objects(see below).

    When I use it I keep getting the warning “expression must be of dimension 2, not 1.

    I realize this is because it is only getting input for the x parameter and it is looking for the x,y but I can’t tell by looking at the code where the parameter is being declared.

    Can any one help??

    // AE expression by George Polevoy

    // http://www.creativecow.net

    // attaches an object to a “Controller” object with a “spring”

    // You need another “Controller” which will drive animation of this one

    // parameters

    conserveMotion = 0.95; // valid range: 0.5 to 0.995

    springResistance = 10; // positive values

    prerollTime = 2; // value in seconds. greater values give more precise result

    //

    fps = 1.0 / this_comp.frame_duration;

    if ( prerollTime > time ) prerollTime = time;

    dt = this_comp.frame_duration;

    frame = time * fps;

    integrationTime = time – prerollTime;

    s = [0,0];

    p = this_comp.layer(“Controller”).position.value_at_time( integrationTime );

    i = frame – prerollTime * fps;

    for (; i < frame; i++, integrationTime += dt ) { c = this_comp.layer("Controller").position.value_at_time( integrationTime ); d = c - p; s = s + d * springResistance; s = s * conserveMotion; p = p + s * dt; } p; Josh

    Activity

    Dan Ebberts
    replied 18 years, 10 months ago
    2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    August 23, 2005 at 5:34 pm

    The only thing I can think of is that you’re running AE 5.0, in which case you would need to use the funky vector math stuff instead of +,-,*,/ for the vector operations.

    Dan

  • Joshua Stanley

    August 23, 2005 at 6:47 pm

    Dan-
    I’m working on AE 6.0 production on a mac. Maybe Ill try this tonight at home on a pc 6.5.

    thanks

    Josh

  • Dan Ebberts

    August 23, 2005 at 9:15 pm

    I’m stumped. I just copied and pasted the expression from your post into AE 6 and it works fine. You are applying it to the position property, right?

    Dan

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