Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions In need of an expression that keeps object at 90 degrees

  • In need of an expression that keeps object at 90 degrees

    Posted by Daniel Jacob on March 2, 2010 at 1:09 am

    Hello Creative Cow…
    I have an issue that I’m sure that a bit of math and expressions can solve and I’m hoping one of you here might have the road map.

    In a nutshell: I’m working on a multi-jointed stick puppet project. I have “sticks” parented to the outer-most arm pieces and I want them to always stay 90 degrees vertical like they would is someone was really beneath it, operating it.

    Of course, since the puppet moves the stick will also move with whatever it’s parented to. In the past I’ve always just key framed the stick back into place but that is time consuming, often sloppy, and tedious. Is there an expression that will flawlessly do it for me?

    (see image below)

    Thanks in advance.
    Daniel Jacob

    “There are three ways to ultimate success. The first way is to be kind. The second way is to be kind. The third way is to be kind” – Fred Rogers

    Daniel Jacob replied 16 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 2, 2010 at 3:29 am

    I think this will work. Get your other pieces set up. The, with your stick vertical, make it the child of the appropriate piece. Then add this rotation expression to the stick:

    r = 0;
    L = thisLayer;
    while(L.hasParent){
    L = L.parent;
    r += L.transform.rotation;
    }
    -r

    The stick should still be vertical and should remain vertical as your rotate its ancestral pieces.

    Dan

  • Daniel Jacob

    March 2, 2010 at 4:41 pm

    Dan Ebberts,
    You’re great! That worked perfectly. Exactly what I needed.
    Many sincere thanks.

    Daniel

    “There are three ways to ultimate success. The first way is to be kind. The second way is to be kind. The third way is to be kind” – Fred Rogers

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