Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions linking time remapping to position

  • linking time remapping to position

    Posted by Ramrod16 on April 26, 2007 at 8:44 pm

    Hello all this is my very first post!

    I have created a crab in AE and precomped and exported the legs to a quicktime movie. I am using this so I don’t have to re render the leg movement everytime. These legs are then parented to the rest of the crab.

    My question is how can I link the time of the legs to the X position of the torso, so that the legs speed up and slow down with the direction of the torso. I have tried various things, but I just can’t crack it. Thanks for your help guys.

    Ramrod16 replied 19 years ago 2 Members · 4 Replies
  • 4 Replies
  • Colin Braley

    April 27, 2007 at 5:27 am

    From what I understand, if the torso is moving to the right, you want the legs layer movie to play regularly and, to play in reverse if the legs layer is moving to the left? If this is the case, enable time remapping on the legs and apply the following expression to the time remap property:


    //begin expression
    torsoLayer = thisComp.layer("TORSO");
    dampen = 1200;
    //--
    dur = this.source.duration;
    finalTime = 0;
    for( i = 0; i < time; i+= thisComp.frameDuration ){ xVeloc = torsoLayer.position.velocityAtTime( i )[0]; finalTime += xVeloc/dampen; } if( finalTime < 0 ) (dur + finalTime) % dur else finalTime % dur //end expression

    This worked fine when I tested it out, but it will look best if the movie of your "legs" layer is looping. Also, since I don't know how fast your torso layer will be moving, you will need to adjust the "dampen" variable until it looks good. If the legs are moving too fast, try increasing the value of dampen. You will also need to pickwhip the "torsoLayer" variable properly.
    ~Colin

  • Ramrod16

    April 27, 2007 at 8:05 pm

    Thanks for the response, I won’t be able to test it until tomarrow, but thanks for such a quick response. I will post something tomarrow after I have tried it. Thanks again!

  • Ramrod16

    May 12, 2007 at 6:27 pm

    Sorry that this has taken so long to test out, this was a personal project and I have been swamped with school and work. I used the expression, but there is an error…

    “After Effects warning: Class ‘Property’ has no property or method named ‘velocityAt’
    Expression Disabled”

    I tried a few things, and could not get it to work. Any help would greatly be appreciated.

    Thanks

    -Chris

  • Ramrod16

    May 14, 2007 at 5:55 pm

    I figured out the problem. It was my fault, the expression worked perfectly. It certainly saves a lot of time trying to eyeball the time remap. Thanks a bunch Colin for your help!

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