FORUMS: list search recent posts

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

FAQ   •   VIEW ALL
 In need of an expression that keeps object at 90 degrees on Mar 2, 2010 at 1:09:38 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)

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

 Re: In need of an expression that keeps object at 90 degreeson Mar 2, 2010 at 3:29:21 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

 Re: In need of an expression that keeps object at 90 degreeson Mar 2, 2010 at 4:41:40 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