Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Wheel rotation expression problem

  • Wheel rotation expression problem

    Posted by Paul Gale on February 1, 2012 at 12:53 pm

    Hi,

    I have a racing car animation with the wheels on the cars rotating based on their width and position in the x axis (based on the great tutorial by Carl Larsen – thanks Carl!). There’s also a random offset so the wheels are in a different rotational position on each car.

    The expression is shown below.

    The car and wheels are in their own comp which is then nested in the “main” comp which is a 3D comp. The wheels rotate correctly in the main comp when the car is dragged in the x axis (by physically moving the car in the comp window etc) BUT when the x position is animated (stopwatch turned on), the wheels don’t rotate although they do rotate in the correct way if I view the nested comp! It’s as if the nested comp isn’t getting updated correctly in the main comp.

    What am I missing? Is it something to do with the nested comp referencing the main comp or a bug or something I don’t understand?

    Any help MOST gratefully received 🙂

    Thanks,

    Paul.

    d=width;
    pi=Math.PI;
    circ=d*pi;
    rot=360/circ;
    seedRandom(12346, true);
    offset=random()*360;
    movex= comp("Main").layer("blue car").transform.position[0];
    scaler= comp("Main").layer("blue car").transform.scale[0]/100;
    (rot*movex/scaler)+offset;

    Paul Gale replied 14 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    February 1, 2012 at 3:43 pm

    It works for me. What version of AE are you using?

    Dan

  • Paul Gale

    February 1, 2012 at 3:47 pm

    Sorry Dan,

    My posts are currently moderated and in the time it’s taken for this post to appear, I’ve discovered the problem – my car comp was offset in time in the main comp – so the wheel animation was actually happening but much later in the comp – duh! Stupid but one of those thing that can take ages to track down. All working now – I love expressions, so cool when you get something relatively (for me!)complicated working 🙂

    Many thanks for the reply though 🙂

    Paul.

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